1. 21 10月, 2016 1 次提交
  2. 05 9月, 2016 1 次提交
  3. 07 8月, 2016 1 次提交
  4. 12 6月, 2016 1 次提交
    • S
      Provide the ability to override the queue adapter used by jobs under · 38c187b0
      Steve Lounsbury 提交于
      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.
      38c187b0
  5. 30 3月, 2016 1 次提交
  6. 25 2月, 2016 1 次提交
  7. 07 2月, 2016 1 次提交
  8. 08 10月, 2015 1 次提交
  9. 03 10月, 2015 3 次提交
  10. 17 8月, 2015 1 次提交
  11. 11 8月, 2015 1 次提交
  12. 28 7月, 2015 1 次提交
  13. 01 5月, 2015 1 次提交
  14. 12 3月, 2015 2 次提交
  15. 07 3月, 2015 1 次提交
  16. 24 2月, 2015 1 次提交
    • T
      `ActiveJob::QueueAdapters::TestAdapter` is now a singleton · 802f855e
      Tamir Duberstein 提交于
      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.
      802f855e
  17. 07 2月, 2015 1 次提交
    • M
      Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on · e818f657
      Michael Ryan 提交于
      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.
      e818f657
  18. 23 1月, 2015 1 次提交
  19. 08 1月, 2015 2 次提交
  20. 30 12月, 2014 1 次提交
    • C
      ActiveJob testing improvements · 8a73f4b5
      Cristian Bica 提交于
      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
      8a73f4b5
  21. 25 11月, 2014 1 次提交
    • F
      Add perform_enqueued_jobs · 4f8eb78b
      Fábio Luiz Nery de Miranda 提交于
      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
      4f8eb78b
  22. 02 11月, 2014 1 次提交
  23. 21 10月, 2014 1 次提交
  24. 23 9月, 2014 1 次提交
  25. 05 9月, 2014 1 次提交
  26. 02 9月, 2014 3 次提交