aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/test_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Job] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveJobKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* correctly set test adapter when configure the queue adapter on a per job ↵Yuji Yaginuma2017-01-311-10/+35
| | | | | | | | | | | | (#26690) The `ActiveJob::TestHelper` replace the adapter to test adapter in `before_setup`. It gets the target class using the `descendants`, but if the test target job class is not loaded, will not be a replacement of the adapter. Therefore, instead of replacing with `before_setup`, modified to replace when setting adapter. Fixes #26360
* Merge pull request #27624 from elfassy/assert_enqueued_jobs_with_queue_levelGuillermo Iguaran2017-01-191-10/+24
|\ | | | | Specify the queue to be used with assert_enqueued_jobs
| * assert_enqueued_jobs with queue optionMichael Elfassy2017-01-181-10/+24
| |
* | s/perfomed/performed/Akira Matsuda2017-01-171-1/+1
|/ | | | [ci skip]
* No need to nodoc private methodsAkira Matsuda2016-12-241-5/+5
|
* remove Ruby warning from Active Job test helper methodsyuuji.yaginuma2016-11-181-4/+4
| | | | | | | | | This removes the following warnings. ``` /home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:241: warning: shadowing outer local variable - job /home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:265: warning: shadowing outer local variable - job ```
* Use named parameters instead of `assert_valid_keys`Maxime Boisvert2016-11-161-8/+8
|
* Add examples of queue_adapter and perform_enqueued jobs to API Docs.Gabi Stefanini2016-10-211-0/+24
|
* use `descendants` to get class that inherited `ActiveJob::Base`yuuji.yaginuma2016-09-051-1/+1
| | | | | | `subclasses` get only child classes. Therefore, if create a job common parent class as `ApplicationJob`, inherited class does not get properly.
* applies new string literal convention in activejob/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Provide the ability to override the queue adapter used by jobs underSteve Lounsbury2016-06-111-1/+14
| | | | | | | | | | | | | test. This PR adds a method called `queue_adapter_for_test` to `ActiveJob::TestHelper`. This method is expected to provide the queue adapter to be used for jobs under test. It maintains the current behaviour by defaulting to an instance of `ActiveJob::QueueAdapter::TestAdapter`. Tests that include `ActiveJob::TestHelper` or extend from `ActiveJob::TestCase` can provide a custom queue adapter by overriding `queue_adapter_for_test` in their class.
* update `assert_no_performed_jobs` doc to use `assert_no_performed_jobs` ↵yuuji.yaginuma2016-03-301-18/+5
| | | | method [ci skip]
* Do not define methods in the included blockRafael Mendonça França2016-02-241-293/+289
| | | | Instance methods can be defined in the module itself
* fix typo in `assert_enqueued_jobs` example [ci skip]yuuji.yaginuma2016-02-071-1/+1
|
* Added missing specs for not modifying queues when using AJ test helpersWojciech Wnętrzak2015-10-071-14/+10
|
* Fixed serializing `:at` option for `assert_enqueued_with` and ↵Wojciech Wnętrzak2015-10-031-4/+11
| | | | `assert_performed_with`
* Support passing array to `assert_enqueued_jobs` in `:only` optionWojciech Wnętrzak2015-10-031-1/+1
|
* Do not document private methods in AJ::TestHelperWojciech Wnętrzak2015-10-021-5/+5
| | | | [CI skip]
* Fix typo on method nameRafael Mendonça França2015-08-161-3/+3
| | | | [Robin Dupret]
* Make assert_enqueued_with and assert_performed_with returns the matched jobJean Boussier2015-08-101-2/+11
|
* Add `:nodoc:` for internal testing methods [ci skip]Robin Dupret2015-07-281-2/+2
|
* match a expected value with message of `assert_equal` in AJ helper methodsyuuji.yaginuma2015-05-011-2/+2
|
* `ActiveJob::Base#queue_adapter` is now a `class_attribute`Tamir Duberstein2015-03-111-3/+15
| | | | | | This allows different `queue_adapters` to be used in each `ActiveJob` class heirarchy. Previously, all subclasses used a single global queue adapter.
* `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