Skip to content

Commit

Permalink
ActiveSupport::SynchronousQueue doesn't have the drain method.
Browse files Browse the repository at this point in the history
Now we are using teh SynchronousQueue in the test environment instead of
the TestQueue
  • Loading branch information
rafaelfranca committed Oct 12, 2012
1 parent 08f57bf commit a284b14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions railties/test/application/queue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a284b14

Please sign in to comment.