1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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