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/lib | |
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/lib')
-rw-r--r-- | activejob/lib/active_job/test_helper.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index 0d895a17db..d18656e398 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -79,11 +79,19 @@ module ActiveJob # end # end # + # It can be asserted that no jobs of a specific kind are enqueued: + # + # def test_no_logging + # assert_no_enqueued_jobs only: LoggingJob do + # HelloJob.perform_later('jeremy') + # end + # end + # # Note: This assertion is simply a shortcut for: # # assert_enqueued_jobs 0, &block - def assert_no_enqueued_jobs(&block) - assert_enqueued_jobs 0, &block + def assert_no_enqueued_jobs(only: nil, &block) + assert_enqueued_jobs 0, only: only, &block end # Asserts that the number of performed jobs matches the given number. |