1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test
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
..
adapters ActiveJob testing improvements 2014-12-30 17:53:42 +02:00
cases Add an :only option to perform_enqueued_jobs to filter jobs based on 2015-02-06 14:11:42 -05:00
integration 💅 fix typos in activejob queuing test 2014-10-22 06:33:10 -07:00
jobs Allow keyword arguments to work with ActiveJob 2015-01-30 13:43:39 -07:00
models [ActiveJob] raise DeserializationError when got an error deserializing 2014-08-17 23:10:45 +00:00
support Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846 2015-01-31 23:12:41 -05:00
helper.rb No need to disable sidikiq tests with 1.9.3 anymore 2015-01-04 15:54:22 -03:00