diff --git a/components/benefit_sponsors/spec/models/benefit_sponsors/services/staff_role_service_spec.rb b/components/benefit_sponsors/spec/models/benefit_sponsors/services/staff_role_service_spec.rb index da80cc1033c..3db057637b0 100644 --- a/components/benefit_sponsors/spec/models/benefit_sponsors/services/staff_role_service_spec.rb +++ b/components/benefit_sponsors/spec/models/benefit_sponsors/services/staff_role_service_spec.rb @@ -522,13 +522,10 @@ module BenefitSponsors context 'when there are both terminated and active broker staff for an agency' do let(:person2) {FactoryBot.create(:person)} - - before do - FactoryBot.create(:broker_agency_staff_role, broker_agency_profile_id: broker_agency_profile.id, person: person2, broker_agency_profile: broker_agency_profile, aasm_state: 'active') - end + let!(:active_broker_agency_staff_role) { FactoryBot.create(:broker_agency_staff_role, broker_agency_profile_id: broker_agency_profile.id, person: person2, broker_agency_profile: broker_agency_profile, aasm_state: 'broker_agency_terminated') } it 'should return active broker staff' do - expect(person.reload.broker_agency_staff_roles.count).to eq 2 + expect(Person.all_broker_staff_roles.count).to eq 2 expect(Person.staff_for_broker_including_pending(broker_agency_profile).count).to eq 1 end end