aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846robertomiranda2015-01-311-1/+1
| | | | ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
* Allow keyword arguments to work with ActiveJobSean Griffin2015-01-302-10/+36
| | | | | | | | | | | | | | | | | 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.
* No need to disable sidikiq tests with 1.9.3 anymoreRafael Mendonça França2015-01-041-11/+0
|
* ActiveJob testing improvementsCristian Bica2014-12-302-2/+4
| | | | | | | | 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
|
* redis 3.2.0 doesn't allow tcp protocol anymoreRafael Mendonça França2014-12-131-1/+1
| | | | Use redis protocol
* Include missing requireDavid Heinemeier Hansson2014-12-051-0/+1
|
* Merge pull request #17817 from aripollak/hide-activejob-argsDavid Heinemeier Hansson2014-12-051-0/+8
|\ | | | | GlobalID objects are logged by their URI, not #inspect on the object, to prevent logging private data
| * 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
* | Merge pull request #17825 from aripollak/fix-activejob-sidekiq-integrationRafael Mendonça França2014-12-041-1/+2
|\ \ | | | | | | | | | | | | | | | | | | Fix Sidekiq ActiveJob integration setup Conflicts: activejob/test/support/integration/adapters/sidekiq.rb
| * | Fix Sidekiq ActiveJob integration setupAri Pollak2014-11-281-1/+2
| |/ | | | | | | | | | | * .connect on a Redis connection wasn't valid * Reset logger after we're done testing for redis connection to avoid "closed stream" error when starting server for real from a fork
* / Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-292-4/+2
|/
* 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.
* Merge pull request #17343 from vipulnsward/inline-aj-callbacksYves Senn2014-10-231-16/+13
|\ | | | | Inline AJ around_perform and around_enqueue in CallbackJob used for tests
| * - Inline AJ around_perform and around_enqueue in CallbackJob used for tests.Vipul A M2014-10-211-16/+13
| |
* | :nail_care: fix typos in activejob queuing testJoe Lewis2014-10-221-2/+2
|/
* - Remove duplication in AJ logging test for setting logger.Vipul A M2014-10-202-3/+1
| | | | - Remove un-needed require in AJ rescue test.
* No need to specify log level, run at log level as all other Rails components.Vipul A M2014-10-201-1/+0
|
* - Removed unused variable warnings from ActiveJob AdaptersVipul A M2014-10-195-5/+5
|
* tests, move `original_` var assignments outside of `begin`.Yves Senn2014-10-102-11/+16
|
* ActiveJob: allow blank queue namesBlake Gentry2014-10-091-0/+20
| | | | | | | As discussed in #17195, Que uses blank queue names by default for performance reasons. At the very least, ActiveJob should allow users to choose "" as their queue name. This commit allows blank queue names, as well as tests to make sure that nil queue names still use the default.
* Make AJ integration tests much less verboseMatthew Draper2014-09-278-26/+14
| | | | In passing, avoid a blind retry in QC: instead, just fix the problem.
* Fix string/gid collision in job argumentsJeremy Kemper2014-09-251-3/+11
| | | | Serialize Global IDs as special objects, distinguishable from Strings
* Merge pull request #17005 from y-yagi/fix_aj_test_helperYves Senn2014-09-231-1/+3
|\ | | | | | | add message to `assert` in `assert_enqueued_with`
| * add message to `assert` in `assert_enqueued_with`yuuji.yaginuma2014-09-231-1/+3
|/
* Tighten up AJ::Arguments and its testsJeremy Kemper2014-09-142-77/+76
| | | | | * Disallow deserialization of non-primitive objects * Broaden coverage; remove superfluous tests
* Se the test order of activejob testsRafael Mendonça França2014-09-121-1/+1
|
* Change gid calls to to_gidRafael Mendonça França2014-09-121-8/+8
|
* ActiveJob Integration TestsCristian Bica2014-09-1116-1/+574
|
* Active Job refactoringCristian Bica2014-09-039-74/+107
|
* Fix for double ActiveJob::DeserializationErorrCristian Bica2014-09-031-0/+5
|
* Merge pull request #16724 from seuros/testcaseRafael Mendonça França2014-09-022-0/+228
|\ | | | | [ActiveJob] TestCase
| * [ActiveJob] TestCase (Will squash before merge)Abdelkader Boudih2014-09-022-4/+2
| |
| * [ActiveJob] TestCaseAbdelkader Boudih2014-09-023-54/+24
| |
| * [ActiveJob] TestCaseAbdelkader Boudih2014-09-022-0/+260
| |
* | ActiveJob: Implemented enqueue_at for QueueClassicCristian Bica2014-09-021-0/+12
|/
* Avoid skipping Sidekiq tests on RubiniusRobin Dupret2014-08-291-8/+2
| | | | | Now that Travis provides support for Rubinius 2.2.10, we can run the Sidekiq tests against this version.
* [ActiveJob] extract JobBuffer from helperAbdelkader Boudih2014-08-295-20/+25
|
* Raise ActiveJob::SerializationError when cannot serialize job argumentsCristian Bica2014-08-241-3/+3
|
* Added enqueue_at support for QueAdapter in ActiveJobNicholas Bruning2014-08-212-0/+11
| | | | | * Added inline job runner for Que in test/support * Updated QueAdapter to support enqueue_at
* [ActiveJob] Add queue_name_prefix so all queue are prefixed .Abdelkader Boudih2014-08-181-0/+15
| | | | | | We can split queues on a per environement basis as well as seggregate per application so we can split queues on a per env basis ActiveJob::Base.queue_name_prefix = 'foo'
* Fix ActiveJob isolation tests.Lucas Mazza2014-08-171-0/+1
|
* [ActiveJob] raise DeserializationError when got an error deserializingCristian Bica2014-08-173-0/+15
|
* [ActiveJob] Fix tests for sucker_punchAbdelkader Boudih2014-08-178-12/+32
|