aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/test_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* `ActiveJob::QueueAdapters::*` are no longer singletonsTamir Duberstein2015-03-111-3/+0
|
* Fix leaky `only: …` option for Active Job assertionsJeremy Kemper2015-03-061-9/+15
| | | | | | | The filter was set on the pseudo-global TestAdapter but not restored to its original value. See e818f65770fe115ab1cc7fbacc0e7e94d92af6a4
* `ActiveJob::QueueAdapters::TestAdapter` is now a singletonTamir Duberstein2015-02-231-2/+4
| | | | | | | | | Since `ActiveJob::TestHelper` globally sets `ActiveJob::Base.queue_adapter` on setup, there is no benefit in instantiating a new `TestAdapter` per tests. The original rationale was to allow parallel tests to run without interference, but since they'd all mutate the global `ActiveJob::Base.queue_adapter`, that was never realized.
* Add an `:only` option to `perform_enqueued_jobs` to filter jobs based onMichael Ryan2015-02-061-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix ActiveJob assertions with a GlobalID object argumentRichard Manyanza2015-01-231-2/+12
|
* Add :only option to assert_no_enqueued_jobsGeorge Claghorn2015-01-081-2/+10
|
* Add :only option to assert_enqueued_jobsGeorge Claghorn2015-01-071-7/+23
| | | | With the option, assert_enqueued_jobs will check the number of times a specific kind of job is enqueued.
* ActiveJob testing improvementsCristian Bica2014-12-301-0/+2
| | | | | | | | 1. The :test adapter wasn't going through a full cycle of serialize/deserialize when performing jobs. Now it does 2. Regular AJ tests were not run for the :test adapter. Now they are 3. ActiveJob::TestHelper uses assert_valid_keys but doesn’t requires the file that implements that method. Now it does
* Add perform_enqueued_jobsFábio Luiz Nery de Miranda2014-11-251-7/+29
| | | | | | | | | It will set proper queue_adapter state required by assert_performed_jobs assertions. Also the block version of assert_performed_jobs will make sure this state is respected. Fixes #17684
* Tiny documentation fixes and styling improvementsRobin Dupret2014-11-011-2/+2
| | | | [ci skip]
* - Fix mentioned shortcut, to what the shortcut actually is, and that it ↵Vipul A M2014-10-211-2/+2
| | | | | | | | accepts blocks for `assert_no_enqueued_jobs` and `assert_no_performed_jobs` test helpers. - args => arguments when used in actual docs. [ci skip]
* add message to `assert` in `assert_enqueued_with`yuuji.yaginuma2014-09-231-1/+1
|
* correct rdoc [ci skip]Abdelkader Boudih2014-09-051-14/+14
|
* [ActiveJob] TestCase (Will squash before merge)Abdelkader Boudih2014-09-021-13/+16
|
* [ActiveJob] TestCaseAbdelkader Boudih2014-09-021-152/+175
|
* [ActiveJob] TestCaseAbdelkader Boudih2014-09-021-0/+170