Skip to content

Commit 662ab6a

Browse files
committed
refactor(tests): fix waiting list reminder assertion
The delivery-assertion refactor incorrectly asserted that already-reminded invitations should have reminded_at as nil. The fabricator sets reminded_at to 2.days.ago, so the correct assertion is that it remains unchanged (still ~2 days ago).
1 parent 5945955 commit 662ab6a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

spec/models/invitation_manager_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@
156156
}.to change { ActionMailer::Base.deliveries.count }.by(invitations.count)
157157

158158
invitations.each { |invitation| expect(invitation.reload.reminded_at).not_to be_nil }
159-
reminded_invitations.each { |invitation| expect(invitation.reload.reminded_at).to be_nil }
159+
reminded_invitations.each do |invitation|
160+
expect(invitation.reload.reminded_at).to be_within(1.second).of(2.days.ago)
161+
end
160162

161163
emails = ActionMailer::Base.deliveries.last(invitations.count)
162164
invitation_emails = invitations.map { |i| i.member.email }

0 commit comments

Comments
 (0)