diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2015-01-08 07:15:39 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2015-01-08 07:15:39 -0800 |
commit | 0e8c7ff7f7988e9b0bfae91ca4f27b200f8f6541 (patch) | |
tree | fa56fcc84dee2a958c01bcd300fea756c6296e35 /activejob/test | |
parent | a22a653c293cc5d378d0bfdd595ad60603c5608d (diff) | |
parent | 3f17fbd68d17e9e51fbd39be772cec9f176ac08f (diff) | |
download | rails-0e8c7ff7f7988e9b0bfae91ca4f27b200f8f6541.tar.gz rails-0e8c7ff7f7988e9b0bfae91ca4f27b200f8f6541.tar.bz2 rails-0e8c7ff7f7988e9b0bfae91ca4f27b200f8f6541.zip |
Merge pull request #18403 from georgeclaghorn/enqueued-email-assertions
Enqueued email assertions
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/test_helper_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb index 21fe3db148..f34638e7d8 100644 --- a/activejob/test/cases/test_helper_test.rb +++ b/activejob/test/cases/test_helper_test.rb @@ -127,6 +127,25 @@ class EnqueuedJobsTest < ActiveJob::TestCase assert_match(/1 .* but 2/, error.message) end + def test_assert_no_enqueued_jobs_with_only_option + assert_nothing_raised do + assert_no_enqueued_jobs only: HelloJob do + LoggingJob.perform_later + end + end + end + + def test_assert_no_enqueued_jobs_with_only_option_failure + error = assert_raise ActiveSupport::TestCase::Assertion do + assert_no_enqueued_jobs only: HelloJob do + HelloJob.perform_later('jeremy') + LoggingJob.perform_later + end + end + + assert_match(/0 .* but 1/, error.message) + end + def test_assert_enqueued_job assert_enqueued_with(job: LoggingJob, queue: 'default') do LoggingJob.set(wait_until: Date.tomorrow.noon).perform_later |