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
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

View File

@ -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 }

View File

@ -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 }