-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear test mailbox from ActionMailer::Base between each example #2293
Conversation
@@ -256,6 +256,31 @@ def self.application; end | |||
expect(group.mailer_class).to be(a_mailer_class) | |||
expect(group.new).to be_a(RSpec::Rails::MailerExampleGroup) | |||
end | |||
|
|||
describe 'cleans test mailbox between each example in all rspec-rails example' do | |||
class BaseMailer < ActionMailer::Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be an anonymous class in a let?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep! Good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain you prefer?
Done with 368484b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean! LGTM
Does this fix the problem you're experiencing @cunknown? |
JRuby failures are unrelated, fixed on JRuby |
It has been tested against the repo provided + the test I wrote with the mailer service. |
@benoittgt Changelog? |
🙏 Thank you! |
@@ -18,6 +18,7 @@ Bug Fixes: | |||
(Jonathan Rochkind, #2242) | |||
* `rails generate generator` command now creates related spec file (Joel Azemar, #2217) | |||
* Relax upper `capybara` version constraint to allow for Capybara 3.x (Phil Pirozhkov, #2281) | |||
* Leans ActionMailer test mailbox after each example (Benoit Tigeot, #2293) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleans :D
We notice in #2290 that
ActionMailer::Base.deliveries mailbox is not cleaned between example.
Fix: #2290