aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/test')
-rw-r--r--activejob/test/cases/test_helper_test.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb
index d0a21a5da3..53b332f6e3 100644
--- a/activejob/test/cases/test_helper_test.rb
+++ b/activejob/test/cases/test_helper_test.rb
@@ -610,7 +610,7 @@ class EnqueuedJobsTest < ActiveJob::TestCase
end
class PerformedJobsTest < ActiveJob::TestCase
- def test_performed_enqueue_jobs_with_only_option_doesnt_leak_outside_the_block
+ def test_perform_enqueued_jobs_with_only_option_doesnt_leak_outside_the_block
assert_nil queue_adapter.filter
perform_enqueued_jobs only: HelloJob do
assert_equal HelloJob, queue_adapter.filter
@@ -618,7 +618,7 @@ class PerformedJobsTest < ActiveJob::TestCase
assert_nil queue_adapter.filter
end
- def test_performed_enqueue_jobs_with_except_option_doesnt_leak_outside_the_block
+ def test_perform_enqueued_jobs_with_except_option_doesnt_leak_outside_the_block
assert_nil queue_adapter.reject
perform_enqueued_jobs except: HelloJob do
assert_equal HelloJob, queue_adapter.reject
@@ -626,6 +626,22 @@ class PerformedJobsTest < ActiveJob::TestCase
assert_nil queue_adapter.reject
end
+ def test_perform_enqueued_jobs_without_block
+ HelloJob.perform_later("kevin")
+
+ assert_performed_jobs 1, only: HelloJob do
+ perform_enqueued_jobs
+ end
+ end
+
+ def test_perform_enqueued_jobs_without_block_respects_filter
+ HelloJob.perform_later("kevin")
+
+ assert_no_performed_jobs do
+ perform_enqueued_jobs only: LoggingJob
+ end
+ end
+
def test_assert_performed_jobs
assert_nothing_raised do
assert_performed_jobs 1 do