aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/cases
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix tests against ActiveSupport::DurationsDavid Heinemeier Hansson2016-08-021-28/+45
|
* Please RubocupDavid Heinemeier Hansson2016-08-021-2/+2
|
* Not neededDavid Heinemeier Hansson2016-08-011-1/+0
|
* Allow for custom handling of exceptions that persist beyond the retry attemptsDavid Heinemeier Hansson2016-08-011-0/+5
|
* Add exponentially_longer and custom wait algorithmsDavid Heinemeier Hansson2016-08-011-0/+39
|
* Use descriptive exception namesDavid Heinemeier Hansson2016-08-011-14/+14
|
* Reraise instead of swallow exceptions that occur beyond the retry attemptsDavid Heinemeier Hansson2016-07-291-1/+1
|
* Satisfy pedantic rubocop whitespace detectionDavid Heinemeier Hansson2016-07-291-4/+4
|
* Add retry_on/discard_on for better exception handlingDavid Heinemeier Hansson2016-07-291-0/+47
|
* Fix AJ tests on ruby 2.4 being causes since classes are unified for Integer, ↵Vipul A M2016-07-091-1/+1
| | | | and we create test name nased on arg class. Append ar as well to the test name
* Fix jobs overriding AJ::Base#loggerJean Boussier2016-06-171-1/+6
|
* Provide the ability to override the queue adapter used by jobs underSteve Lounsbury2016-06-111-0/+12
| | | | | | | | | | | | | 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.
* Added more tests for reserved hash keys of ActiveJob::Arguments.Santosh Wadghule2016-03-171-6/+7
| | | | | | - Added tests for checking all reserved hash keys of ActiveJob::Arguments. - Moved unrelated code from the test to the correct place, i.e. newly created test.
* Add JSON round trip verification testcaseMike Perham2016-03-091-1/+16
|
* Job payload should be symmetric across JSON dump/loadMike Perham2016-03-091-3/+3
| | | Placing non-native JSON data types, like symbols, in the hash to serialize means that the deserialize method will return something different from what was serialized, a common bug and source of frustration for devs.
* Active Job: smaller footprint for the dev/test async adapterJeremy Daer2016-02-291-42/+0
| | | | | Use one shared worker pool for all queues with 0-#CPU workers rather than separate pools per queue with 2-10*#CPU workers each.
* Added support for bigdecimals in perform laterSiva Gollapalli2015-12-031-1/+1
|
* Added missing specs for not modifying queues when using AJ test helpersWojciech Wnętrzak2015-10-071-0/+21
|
* Merge pull request #21854 from morgoth/fix-serializing-at-option-in-aj-matchersYves Senn2015-10-051-4/+22
|\ | | | | | | Fixed serializing `:at` option for `assert_eqnueued_with` and `assert_performed_with`
| * Fixed serializing `:at` option for `assert_enqueued_with` and ↵Wojciech Wnętrzak2015-10-031-4/+16
|/ | | | `assert_performed_with`
* Support passing array to `assert_enqueued_jobs` in `:only` optionWojciech Wnętrzak2015-10-031-0/+18
|
* Merge pull request #19425 from wvengen/feature/activejob-priority-masterRafael Mendonça França2015-09-251-0/+47
|\ | | | | Add job priorities to ActiveJob
| * Add job priorities to ActiveJobwvengen2015-09-171-0/+47
| |
* | :hocho: TyposAkira Matsuda2015-09-211-1/+1
|/
* Properly log nested parameters to Active JobMarek Pieczyk2015-09-081-0/+8
| | | | Refactor arguments logging method for Active Job
* Initial implementation of ActiveJob AsyncAdapter.Jerry D'Antonio2015-08-251-0/+42
|
* Make assert_enqueued_with and assert_performed_with returns the matched jobJean Boussier2015-08-101-0/+22
|
* Add missing HelloJob require.Kasper Timm Hansen2015-08-051-0/+1
| | | | This way JobSerializationTest runs in isolation without errors.
* Fixes #20799Johannes Opper2015-08-042-0/+36
| | | | | | | | | | | | | | | | | | | | | | When `#perform_later` is called the locale isn't stored on the queue, which results in a locale reset when the job is performed. An example of the problem: I18n.locale = 'de' HelloJob.perform_now # german message, correct but I18n.locale = 'de' HelloJob.perform_later # english message, incorrect This PR attaches the current I18n.locale to every job during the serialization process. It is then restored during deserialization and used to perform the job with the correct locale. It falls back to the default locale if no serialized locale is found in order to provide backward compatibility with previously stored jobs. It is not necessary to clear the queue for the update.
* Improve error message when serializing unsaved records for jobsFaraz Yashar2015-06-281-0/+7
|
* Fix spelling mistakesYoong Kang Lim2015-05-251-4/+4
|
* Merge pull request #19969 from y-yagi/fix_job_helper_methodYves Senn2015-05-011-0/+22
| | | | match a expected value with message of `assert_equal` in AJ helper methods
* `ActiveJob::Base#queue_adapter` is now a `class_attribute`Tamir Duberstein2015-03-112-5/+46
| | | | | | 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-113-2/+26
|
* Fix naming collisionTamir Duberstein2015-03-111-1/+1
|
* Fix leaky `only: …` option for Active Job assertionsJeremy Kemper2015-03-061-0/+8
| | | | | | | 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-1/+1
| | | | | | | | | 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.
* Changed the AJADAPTER to AJ_ADAPTERJeroen van Baarsen2015-02-221-2/+2
| | | | | | | * This allows for easier reading, since those are two words, so they should be split by _ Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Add an `:only` option to `perform_enqueued_jobs` to filter jobs based onMichael Ryan2015-02-061-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow keyword arguments to work with ActiveJobSean Griffin2015-01-301-10/+29
| | | | | | | | | | | | | | | | | Unfortunately, the HashWithIndifferent access approach is insufficient for our needs. It's perfectly reasonable to want to use keyword arguments with Active Job, which we will see as a symbol keyed hash. For Ruby to convert this back to keyword arguments, it must deserialize to a symbol keyed hash. There are two primary changes to the serialization behavior. We first treat a HWIA separately, and mark it as such so we can convert it back into a HWIA during deserialization. For normal hashes, we keep a list of all symbol keys, and convert them back to symbol keys after deserialization. Fixes #18741.
* Fix ActiveJob assertions with a GlobalID object argumentRichard Manyanza2015-01-231-0/+39
|
* Add :only option to assert_no_enqueued_jobsGeorge Claghorn2015-01-081-0/+19
|
* Add :only option to assert_enqueued_jobsGeorge Claghorn2015-01-071-0/+40
| | | | 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-2/+1
| | | | | | | | 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
* Expectation comes firstYukio Mizuta2014-12-281-1/+1
|
* Include missing requireDavid Heinemeier Hansson2014-12-051-0/+1
|
* Only filter GIDable objects; remove cosmetic changesAri Pollak2014-12-011-10/+10
|
* Hide potentially sensitive ActiveJob params from logsAri Pollak2014-11-281-10/+18
| | | | * Show GlobalID instead of full object .inspect output
* Add perform_enqueued_jobsFábio Luiz Nery de Miranda2014-11-251-13/+23
| | | | | | | | | 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
* Added queue_name_delimiter attribute.Terry Meacham2014-10-261-1/+18
| | | | | | | | - Added ActiveJob::Base#queue_name_delimiter to allow for developers using ActiveJob to change the delimiter from the default ('_') to whatever else they may be using (e.g., '.', '-', ...). - Updated source guide to include a blurb about the delimiter.