diff options
-rw-r--r-- | activejob/lib/active_job/test_helper.rb | 2 | ||||
-rw-r--r-- | activejob/test/cases/test_helper_test.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index fa0576669e..af62fae9b9 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -150,7 +150,7 @@ module ActiveJob matching_job = enqueued_jobs.any? do |job| args.all? { |key, value| value == job[key] } end - assert matching_job + assert matching_job, "No enqueued job found with #{args}" ensure queue_adapter.enqueued_jobs = original_enqueued_jobs + enqueued_jobs end diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb index eab540bb6c..71c505a65f 100644 --- a/activejob/test/cases/test_helper_test.rb +++ b/activejob/test/cases/test_helper_test.rb @@ -97,11 +97,13 @@ class EnqueuedJobsTest < ActiveJob::TestCase end end - assert_raise ActiveSupport::TestCase::Assertion do + error = assert_raise ActiveSupport::TestCase::Assertion do assert_enqueued_with(job: NestedJob, queue: 'low') do NestedJob.perform_later end end + + assert_equal 'No enqueued job found with {:job=>NestedJob, :queue=>"low"}', error.message end def test_assert_enqueued_job_args |