Conversation
There was a problem hiding this comment.
Turns out body: is only comparing against the plaintext version of the email, so checking for HTML here fails.
Previously, we weren't correctly processing these body checks, so this was erroneously passing prior to this PR
There was a problem hiding this comment.
I sometimes wonder how many tests erroneously pass and conceal bugs. 😬 Glad you found this.
spec/support/mailer_helper.rb
Outdated
There was a problem hiding this comment.
TBH I would like to rework this as an Rspec matcher, something like
expect { some_code }.to have_delivered_email(...)But I needed to limit scope a little here
There was a problem hiding this comment.
I agree with you on both counts—that would be nice, but this is a good step forward for now.
- Slightly improve error output - Capture behavior in a dedicated spec [skip changelog]
Assert that a certain email was not sent.
These specs weren't actually testing the thing we thought they were, since the text_part of the email did not contain HTML.
7329299 to
3dffdd8
Compare
There was a problem hiding this comment.
I sometimes wonder how many tests erroneously pass and conceal bugs. 😬 Glad you found this.
spec/support/mailer_helper.rb
Outdated
There was a problem hiding this comment.
I agree with you on both counts—that would be nice, but this is a good step forward for now.
* Rework mailer_helper and add spec - Slightly improve error output - Capture behavior in a dedicated spec [skip changelog] * Add expect_email_not_delivered helper Assert that a certain email was not sent. * Update alert_user_about_account_verified_spec These specs weren't actually testing the thing we thought they were, since the text_part of the email did not contain HTML.
🛠 Summary of changes
mailer_helper.rb provides the
expect_delivered_emailhelper, which we use in our specs to assert that an email was sent.This PR:
expect_email_not_delivered