diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-05-01 08:53:18 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-05-01 08:59:58 +0200 |
commit | 4d4950fae9e2a6970b5f1793aadc56a0b44e28a3 (patch) | |
tree | 934bb07ac5052a6ec4768fb489c1d5f285f00eeb /activejob/test | |
parent | 8fd46330095b3c1a5d7461c194028e22d9b77b97 (diff) | |
parent | 915086669834a5e238aafab4e41547ccfe175f34 (diff) | |
download | rails-4d4950fae9e2a6970b5f1793aadc56a0b44e28a3.tar.gz rails-4d4950fae9e2a6970b5f1793aadc56a0b44e28a3.tar.bz2 rails-4d4950fae9e2a6970b5f1793aadc56a0b44e28a3.zip |
Merge pull request #19969 from y-yagi/fix_job_helper_method
match a expected value with message of `assert_equal` in AJ helper methods
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/test_helper_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb index 19a2820a6e..04c4c446e2 100644 --- a/activejob/test/cases/test_helper_test.rb +++ b/activejob/test/cases/test_helper_test.rb @@ -31,6 +31,17 @@ class EnqueuedJobsTest < ActiveJob::TestCase end end + def test_assert_enqueued_jobs_message + HelloJob.perform_later('sean') + e = assert_raises Minitest::Assertion do + assert_enqueued_jobs 2 do + HelloJob.perform_later('sean') + end + end + assert_match "Expected: 2", e.message + assert_match "Actual: 1", e.message + end + def test_assert_enqueued_jobs_with_no_block assert_nothing_raised do HelloJob.perform_later('rafael') @@ -230,6 +241,17 @@ class PerformedJobsTest < ActiveJob::TestCase end end + def test_assert_performed_jobs_message + HelloJob.perform_later('sean') + e = assert_raises Minitest::Assertion do + assert_performed_jobs 2 do + HelloJob.perform_later('sean') + end + end + assert_match "Expected: 2", e.message + assert_match "Actual: 1", e.message + end + def test_assert_performed_jobs_with_no_block assert_nothing_raised do perform_enqueued_jobs do |