test/test_sidetiq.rb in sidetiq-0.3.0 vs test/test_sidetiq.rb in sidetiq-0.3.1
- old
+ new
@@ -21,11 +21,11 @@
assert_equal 2, workers.length
end
def test_scheduled
SimpleWorker.perform_at(Time.local(2011, 1, 1, 1))
- SimpleWorker.client_push_old(SimpleWorker.jobs.first)
+ Sidekiq::Client.push_old(SimpleWorker.jobs.first)
scheduled = Sidetiq.scheduled
assert_kind_of Array, scheduled
assert_kind_of Sidekiq::SortedEntry, scheduled.first
@@ -36,24 +36,24 @@
assert_equal 0, Sidetiq.scheduled.length
end
def test_scheduled_given_arguments
SimpleWorker.perform_at(Time.local(2011, 1, 1, 1))
- SimpleWorker.client_push_old(SimpleWorker.jobs.first)
+ Sidekiq::Client.push_old(SimpleWorker.jobs.first)
assert_equal 1, Sidetiq.scheduled(SimpleWorker).length
assert_equal 0, Sidetiq.scheduled(ScheduledWorker).length
assert_equal 1, Sidetiq.scheduled("SimpleWorker").length
assert_equal 0, Sidetiq.scheduled("ScheduledWorker").length
end
def test_scheduled_yields_each_job
SimpleWorker.perform_at(Time.local(2011, 1, 1, 1))
- SimpleWorker.client_push_old(SimpleWorker.jobs.first)
+ Sidekiq::Client.push_old(SimpleWorker.jobs.first)
ScheduledWorker.perform_at(Time.local(2011, 1, 1, 1))
- ScheduledWorker.client_push_old(ScheduledWorker.jobs.first)
+ Sidekiq::Client.push_old(ScheduledWorker.jobs.first)
jobs = []
Sidetiq.scheduled { |job| jobs << job }
assert_equal 2, jobs.length