1
0
Fork 0

Improve factories

This commit is contained in:
Alex Kotov 2018-12-05 05:30:22 +05:00
parent 95f10b8022
commit 021d69ad67
No known key found for this signature in database
GPG key ID: 4E831250F47DE154
3 changed files with 6 additions and 2 deletions

View file

@ -1,7 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
FactoryBot.define do 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 association :user
end end
end end

View file

@ -2,7 +2,7 @@
FactoryBot.define do FactoryBot.define do
factory :membership_application do factory :membership_application do
association :account, factory: :account_with_user association :account, factory: :empty_account
association :country_state association :country_state
first_name { Faker::Name.first_name } first_name { Faker::Name.first_name }

View file

@ -2,6 +2,8 @@
FactoryBot.define do FactoryBot.define do
factory :user do factory :user do
association :account, factory: :empty_account
email { Faker::Internet.email } email { Faker::Internet.email }
password { Faker::Internet.password } password { Faker::Internet.password }
password_confirmation { password } password_confirmation { password }