diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-01-19 20:23:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-19 20:23:58 -0500 |
commit | 1a752b6f2bd18997b3d3b2a614fd285975f56f72 (patch) | |
tree | ebd86a3db28b6b043bc18c587dafb71ace77165e /activejob/test/cases | |
parent | 2e91b6bf214b32149f62c17b5da9527749ad83b5 (diff) | |
parent | 3738358135dba55d120053f111cf6258419746fd (diff) | |
download | rails-1a752b6f2bd18997b3d3b2a614fd285975f56f72.tar.gz rails-1a752b6f2bd18997b3d3b2a614fd285975f56f72.tar.bz2 rails-1a752b6f2bd18997b3d3b2a614fd285975f56f72.zip |
Merge pull request #27624 from elfassy/assert_enqueued_jobs_with_queue_level
Specify the queue to be used with assert_enqueued_jobs
Diffstat (limited to 'activejob/test/cases')
-rw-r--r-- | activejob/test/cases/test_helper_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb index 51fc6cc0c4..5488ce3d58 100644 --- a/activejob/test/cases/test_helper_test.rb +++ b/activejob/test/cases/test_helper_test.rb @@ -110,6 +110,27 @@ class EnqueuedJobsTest < ActiveJob::TestCase end end + def test_assert_enqueued_jobs_with_only_and_queue_option + assert_nothing_raised do + assert_enqueued_jobs 1, only: HelloJob, queue: :some_queue do + HelloJob.set(queue: :some_queue).perform_later + HelloJob.set(queue: :other_queue).perform_later + LoggingJob.perform_later + end + end + end + + def test_assert_enqueued_jobs_with_queue_option + assert_nothing_raised do + assert_enqueued_jobs 2, queue: :default do + HelloJob.perform_later + LoggingJob.perform_later + HelloJob.set(queue: :other_queue).perform_later + LoggingJob.set(queue: :other_queue).perform_later + end + end + end + def test_assert_enqueued_jobs_with_only_option_and_none_sent error = assert_raise ActiveSupport::TestCase::Assertion do assert_enqueued_jobs 1, only: HelloJob do |