diff --git a/factories/accounts.rb b/factories/accounts.rb index 69faf96..16fd1b8 100644 --- a/factories/accounts.rb +++ b/factories/accounts.rb @@ -8,7 +8,7 @@ FactoryBot.define do end factory :personal_account, parent: :usual_account do - association :person + association :person, factory: :initial_person end factory :superuser_account, parent: :personal_account do diff --git a/factories/people.rb b/factories/people.rb index a3d0841..ee49a74 100644 --- a/factories/people.rb +++ b/factories/people.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true FactoryBot.define do - factory :person do - end + factory :initial_person, class: Person end diff --git a/features/step_definitions/user.rb b/features/step_definitions/user.rb index b2cf728..dff909c 100644 --- a/features/step_definitions/user.rb +++ b/features/step_definitions/user.rb @@ -41,7 +41,7 @@ Given 'I am signed in with email {string} ' \ end Given 'I am signed in as party member' do - @person = create :person + @person = create :initial_person @account = create :usual_account, person: @person create :membership_app, account: @account @user = @account.user diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 8bce052..f46e71c 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.describe Person do - subject { create :person } + subject { create :initial_person } it { is_expected.to belong_to(:regional_office).optional }