From 10cc06809d3cc77f861b44b866b8d0577497a574 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Wed, 14 Mar 2018 01:22:07 +0200 Subject: [PATCH] Partly revert #32231 - Remove extra execution of `perform_enqueued_jobs` since it performs all enqueued jobs in the duration of the block. - Fix example of using `assert_emails` without block since we can't use enqueued jobs in this case. --- actionmailer/lib/action_mailer/test_helper.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/actionmailer/lib/action_mailer/test_helper.rb b/actionmailer/lib/action_mailer/test_helper.rb index ec748236b4..e9ddef3b94 100644 --- a/actionmailer/lib/action_mailer/test_helper.rb +++ b/actionmailer/lib/action_mailer/test_helper.rb @@ -14,7 +14,7 @@ module TestHelper # assert_emails 0 # ContactMailer.welcome.deliver_now # assert_emails 1 - # ContactMailer.welcome.deliver_later + # ContactMailer.welcome.deliver_now # assert_emails 2 # end # @@ -38,9 +38,7 @@ def assert_emails(number, &block) new_count = ActionMailer::Base.deliveries.size assert_equal number, new_count - original_count, "#{number} emails expected, but #{new_count - original_count} were sent" else - perform_enqueued_jobs(only: [ActionMailer::DeliveryJob, ActionMailer::Parameterized::DeliveryJob]) do - assert_equal number, ActionMailer::Base.deliveries.size - end + assert_equal number, ActionMailer::Base.deliveries.size end end -- GitLab