Permalink
Browse files

ActiveSupport::SynchronousQueue doesn't have the drain method.

Now we are using teh SynchronousQueue in the test environment instead of
the TestQueue
  • Loading branch information...
1 parent 08f57bf commit a284b145dab008b097eb1046fd86aa9e6469fc25 @rafaelfranca rafaelfranca committed Oct 12, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 railties/test/application/queue_test.rb
@@ -58,12 +58,12 @@ def ran?
refute job.ran_in_different_thread?, "Expected job to run in the same thread"
end
- test "in test mode, explicitly draining the queue will process it in the same thread" do
+ test "in test mode, an enqueued job will be processed in the same thread" do
app("test")
- Rails.queue.push ThreadTrackingJob.new
- job = Rails.queue.jobs.last
- Rails.queue.drain
+ job = ThreadTrackingJob.new
+ Rails.queue.push job
+ sleep 0.1
assert job.ran?, "Expected job to be run"
refute job.ran_in_different_thread?, "Expected job to run in the same thread"

0 comments on commit a284b14

Please sign in to comment.