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.
This commit is contained in:
bogdanvlviv 2018-03-14 01:22:07 +02:00
parent f7e7fdc52c
commit 10cc06809d
No known key found for this signature in database
GPG Key ID: E4ACD76A6DB6DFDD
1 changed files with 2 additions and 4 deletions

View File

@ -14,7 +14,7 @@ module ActionMailer
# 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 @@ module ActionMailer
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