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
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
..
queue_adapters Add an :only option to perform_enqueued_jobs to filter jobs based on 2015-02-06 14:11:42 -05:00
arguments.rb Allow keyword arguments to work with ActiveJob 2015-01-30 13:43:39 -07:00
base.rb docs, minor changes in Active Job documentation. [ci skip] 2014-11-10 14:56:07 +01:00
callbacks.rb Merge pull request #18274 from rajcybage/spell_fix 2014-12-31 11:26:23 +01:00
configured_job.rb Rename remaining :in / :at to :wait / :wait_until 2014-09-04 08:08:06 +03:00
core.rb Tiny follow-up to #18260 [ci skip] 2014-12-31 17:35:41 +01:00
enqueuing.rb Correct fixed-width doc syntax, thanks to @sikachu for pointing it out! 2014-11-03 19:31:31 -08:00
execution.rb Document AJ::Execution class methods module [ci skip] 2014-11-03 19:23:36 -08:00
gem_version.rb Start Rails 5 development 🎉 2014-11-28 15:00:06 -02:00
logging.rb Inline to_global_id conversion 2014-12-04 18:25:05 -05:00
queue_adapter.rb ActiveJob is not ActionJob [ci skip] 😄 2014-12-31 11:27:32 +05:30
queue_adapters.rb [ci skip] add "Qu" to Backends Features list 2014-11-15 13:48:52 +09:00
queue_name.rb Document included ability of AJ::QueueName module for class methods [ci skip] 2014-11-03 19:26:04 -08:00
railtie.rb [ActiveJob] require global_id/railtie 2014-08-17 23:17:38 +00:00
test_case.rb [ActiveJob] TestCase (Will squash before merge) 2014-09-02 14:26:43 +00:00
test_helper.rb Add an :only option to perform_enqueued_jobs to filter jobs based on 2015-02-06 14:11:42 -05:00
version.rb ActiveJob -> Active Job [ci skip] 2014-08-21 23:28:10 +02:00