Skip to content

Commit

Permalink
fix: flaky spec in youth wagon
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosteiner committed Sep 5, 2024
1 parent ac5767e commit 13884a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/domain/synchronize/mailchimp/subscriber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@
AdditionalEmail.new(label: 'vater', email: '[email protected]', mailings: true)
end

subject { described_class.mailing_list_subscribers(mailing_list) }
subject(:subscribers) { described_class.mailing_list_subscribers(mailing_list) }

context 'default strategy' do
it 'returns all people and their manager' do
manager = Fabricate(:person)
person.managers = [manager]

subscribers = subject
expect(subscribers.count).to eq(2)

managed_subscriber = subscribers.first
manager_subscriber = subscribers.last
managed_subscriber = subscribers.find { _1.person == person }
manager_subscriber = subscribers.find { _1.person == manager }

expect(managed_subscriber).to be_present
expect(managed_subscriber.email).to eq(person.email)
expect(managed_subscriber.person).to eq(person)

expect(manager_subscriber).to be_present
expect(manager_subscriber.email).to eq(manager.email)
expect(manager_subscriber.person).to eq(manager)
end
Expand Down

0 comments on commit 13884a7

Please sign in to comment.