1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/lib/active_job/queue_adapters
Michael Ryan e818f65770 Add an :only option to perform_enqueued_jobs to filter jobs based on
type.

This allows specific jobs to be tested, while preventing others from
being performed unnecessarily.

Example:

    def test_hello_job
      assert_performed_jobs 1, only: HelloJob do
        HelloJob.perform_later('jeremy')
        LoggingJob.perform_later
      end
    end

An array may also be specified, to support testing multiple jobs.

Example:

    def test_hello_and_logging_jobs
      assert_nothing_raised do
        assert_performed_jobs 2, only: [HelloJob, LoggingJob] do
          HelloJob.perform_later('jeremy')
          LoggingJob.perform_later('stewie')
          RescueJob.perform_later('david')
        end
      end
    end

Fixes #18802.

Trim space and document :only option.
2015-02-06 14:11:42 -05:00
..
backburner_adapter.rb Added RDoc for each Active Job adapter 2014-09-22 17:33:02 +03:00
delayed_job_adapter.rb added punctuations, and role of queue_adapter module [ci skip] 2014-11-01 06:15:13 +05:30
inline_adapter.rb Replace guides.ror.org/v4.2.0 with guides.ror.org 2014-12-20 05:37:09 -08:00
qu_adapter.rb Tiny follow-up to #16999 [ci skip] 2014-09-27 16:22:15 +02:00
que_adapter.rb Added RDoc for each Active Job adapter 2014-09-22 17:33:02 +03:00
queue_classic_adapter.rb - Fix error string raised from enqueue_at 2014-10-22 19:26:46 +05:30
resque_adapter.rb Added RDoc for each Active Job adapter 2014-09-22 17:33:02 +03:00
sidekiq_adapter.rb Don't pass retry option to Sidekiq 2014-10-08 13:41:38 -04:00
sneakers_adapter.rb Added RDoc for each Active Job adapter 2014-09-22 17:33:02 +03:00
sucker_punch_adapter.rb Added RDoc for each Active Job adapter 2014-09-22 17:33:02 +03:00
test_adapter.rb Add an :only option to perform_enqueued_jobs to filter jobs based on 2015-02-06 14:11:42 -05:00