diff --git a/factories/accounts.rb b/factories/accounts.rb index a2b558d..4284b95 100644 --- a/factories/accounts.rb +++ b/factories/accounts.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true FactoryBot.define do - factory :account_with_user, class: Account do + factory :empty_account, class: Account + + factory :account_with_user, parent: :empty_account do association :user end end diff --git a/factories/membership_applications.rb b/factories/membership_applications.rb index 53a9fef..c4e40d8 100644 --- a/factories/membership_applications.rb +++ b/factories/membership_applications.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :membership_application do - association :account, factory: :account_with_user + association :account, factory: :empty_account association :country_state first_name { Faker::Name.first_name } diff --git a/factories/users.rb b/factories/users.rb index dc14bcc..620a200 100644 --- a/factories/users.rb +++ b/factories/users.rb @@ -2,6 +2,8 @@ FactoryBot.define do factory :user do + association :account, factory: :empty_account + email { Faker::Internet.email } password { Faker::Internet.password } password_confirmation { password }