From cdd23ae43ebf5361093a3db933e15630cd91f65c Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Fri, 7 Sep 2012 09:02:23 -0700 Subject: [PATCH] Now with test! --- test/test_testing.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_testing.rb b/test/test_testing.rb index 7bab5241..4ea63b15 100644 --- a/test/test_testing.rb +++ b/test/test_testing.rb @@ -48,6 +48,7 @@ class TestTesting < MiniTest::Unit::TestCase before do load 'sidekiq/testing.rb' + EnqueuedWorker.jobs.clear end after do @@ -93,6 +94,12 @@ class TestTesting < MiniTest::Unit::TestCase assert_equal 1, EnqueuedWorker.jobs.size end + it 'stubs the enqueue_to call' do + assert_equal 0, EnqueuedWorker.jobs.size + assert Sidekiq::Client.enqueue_to('someq', EnqueuedWorker, 1, 2) + assert_equal 1, EnqueuedWorker.jobs.size + end + it 'executes all stored jobs' do assert StoredWorker.perform_async(false) assert StoredWorker.perform_async(true)