diff options
Diffstat (limited to 'spec/support/helpers/email_helpers.rb')
-rw-r--r-- | spec/support/helpers/email_helpers.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/helpers/email_helpers.rb b/spec/support/helpers/email_helpers.rb index ad6e1064499..ed049daba80 100644 --- a/spec/support/helpers/email_helpers.rb +++ b/spec/support/helpers/email_helpers.rb @@ -16,7 +16,9 @@ module EmailHelpers end def should_email(user, times: 1, recipients: email_recipients) - expect(sent_to_user(user, recipients: recipients)).to eq(times) + amount = sent_to_user(user, recipients: recipients) + failed_message = lambda { "User #{user.username} (#{user.id}): email test failed (expected #{times}, got #{amount})" } + expect(amount).to eq(times), failed_message end def should_not_email(user, recipients: email_recipients) |