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

Add missing perform_enqueued_jobs to error logging test

Without `perform_enqueued_jobs`, job are not executed and assertion is not done.
This commit is contained in:
yuuji.yaginuma 2018-09-09 13:46:43 +09:00
parent fc173b0a24
commit 9d848d8545

View file

@ -160,7 +160,7 @@ class LoggingTest < ActiveSupport::TestCase
end
def test_job_error_logging
RescueJob.perform_later "other"
perform_enqueued_jobs { RescueJob.perform_later "other" }
rescue RescueJob::OtherError
assert_match(/Performing RescueJob \(Job ID: .*?\) from .*? with arguments:.*other/, @logger.messages)
assert_match(/Error performing RescueJob \(Job ID: .*?\) from .*? in .*ms: RescueJob::OtherError \(Bad hair\):\n.*\brescue_job\.rb:\d+:in `perform'/, @logger.messages)