aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/cases/test_helper_test.rb
diff options
context:
space:
mode:
authorMichael Elfassy <michael.elfassy@shopify.com>2017-01-09 15:40:32 -0500
committerMichael Elfassy <michael.elfassy@shopify.com>2017-01-18 09:13:16 -0500
commit3738358135dba55d120053f111cf6258419746fd (patch)
treec63c0f54f589df6b8cb5415bd0b9d755b199f690 /activejob/test/cases/test_helper_test.rb
parent3bc747bd8676dc940b531067e2861dcd4ac28efc (diff)
downloadrails-3738358135dba55d120053f111cf6258419746fd.tar.gz
rails-3738358135dba55d120053f111cf6258419746fd.tar.bz2
rails-3738358135dba55d120053f111cf6258419746fd.zip
assert_enqueued_jobs with queue option
Diffstat (limited to 'activejob/test/cases/test_helper_test.rb')
-rw-r--r--activejob/test/cases/test_helper_test.rb21
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