diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-23 23:02:51 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-23 23:02:51 -0300 |
commit | 29484043a72677362e9c828ed76213e1c55edd04 (patch) | |
tree | 9cdf6db4255f4cb6a95e360c1f42f611381b32a9 /activejob/lib/active_job/test_helper.rb | |
parent | 5cde30298092cda13c5284aeda7721086d25e699 (diff) | |
parent | 802f855ecf95d36982482182adcb007d505e2178 (diff) | |
download | rails-29484043a72677362e9c828ed76213e1c55edd04.tar.gz rails-29484043a72677362e9c828ed76213e1c55edd04.tar.bz2 rails-29484043a72677362e9c828ed76213e1c55edd04.zip |
Merge pull request #19052 from square/testing-singleton
`ActiveJob::QueueAdapters::TestAdapter` is now a singleton
Diffstat (limited to 'activejob/lib/active_job/test_helper.rb')
-rw-r--r-- | activejob/lib/active_job/test_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index 25bc99a4f8..66508114d1 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -7,10 +7,12 @@ module ActiveJob included do def before_setup - @old_queue_adapter = queue_adapter + @old_queue_adapter = queue_adapter ActiveJob::Base.queue_adapter = :test clear_enqueued_jobs clear_performed_jobs + queue_adapter.perform_enqueued_jobs = false + queue_adapter.perform_enqueued_at_jobs = false super end @@ -281,7 +283,7 @@ module ActiveJob def enqueued_jobs_size(only: nil) if only - enqueued_jobs.select { |job| job[:job] == only }.size + enqueued_jobs.select { |job| job.fetch(:job) == only }.size else enqueued_jobs.size end |