mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
e818f65770
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. |
||
---|---|---|
.. | ||
queue_adapters | ||
arguments.rb | ||
base.rb | ||
callbacks.rb | ||
configured_job.rb | ||
core.rb | ||
enqueuing.rb | ||
execution.rb | ||
gem_version.rb | ||
logging.rb | ||
queue_adapter.rb | ||
queue_adapters.rb | ||
queue_name.rb | ||
railtie.rb | ||
test_case.rb | ||
test_helper.rb | ||
version.rb |