未验证 提交 10cc0680 编写于 作者: B bogdanvlviv

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.
上级 f7e7fdc5
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册