test/test_sidetiq.rb in sidetiq-0.3.1 vs test/test_sidetiq.rb in sidetiq-0.3.2

- old
+ new

@@ -21,11 +21,12 @@ assert_equal 2, workers.length end def test_scheduled SimpleWorker.perform_at(Time.local(2011, 1, 1, 1)) - Sidekiq::Client.push_old(SimpleWorker.jobs.first) + hash = SimpleWorker.jobs.first + Sidekiq::Client.push_old(hash.merge("at" => hash["enqueued_at"])) scheduled = Sidetiq.scheduled assert_kind_of Array, scheduled assert_kind_of Sidekiq::SortedEntry, scheduled.first @@ -36,24 +37,27 @@ assert_equal 0, Sidetiq.scheduled.length end def test_scheduled_given_arguments SimpleWorker.perform_at(Time.local(2011, 1, 1, 1)) - Sidekiq::Client.push_old(SimpleWorker.jobs.first) + hash = SimpleWorker.jobs.first + Sidekiq::Client.push_old(hash.merge("at" => hash["enqueued_at"])) 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)) - Sidekiq::Client.push_old(SimpleWorker.jobs.first) + hash = SimpleWorker.jobs.first + Sidekiq::Client.push_old(hash.merge("at" => hash["enqueued_at"])) ScheduledWorker.perform_at(Time.local(2011, 1, 1, 1)) - Sidekiq::Client.push_old(ScheduledWorker.jobs.first) + hash = ScheduledWorker.jobs.first + Sidekiq::Client.push_old(hash.merge("at" => hash["enqueued_at"])) jobs = [] Sidetiq.scheduled { |job| jobs << job } assert_equal 2, jobs.length