Improve factories
This commit is contained in:
parent
95f10b8022
commit
021d69ad67
3 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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 }
|
||||
|
|
Reference in a new issue