I'm trying to write some test for my Sidekiq jobs that use Sidetiq and I can't seem to get it to work. I've found an issue on the sidetiq repo dealing with this problem but no one has answered it so I thought I could bring it to stackoverflow to get some answers and clarity.
Here is the link to the issue:https://github.com/tobiassvn/sidetiq/issues/72
and here is the code that won't seem to work:
spec.rb
# sat 1st feb
Timecop.travel Time.local(2014, 2, 1, 1, 1, 1) do
sign_up_and_onboard user[:email], user[:password]
# sunday 2nd feb, 8pm
Timecop.travel Time.local(2014, 2, 2, 20, 1, 1) do
puts 'should have fired'
end
end
worker.rb
recurrence { weekly.day(:sunday).hour_of_day(8) }
def perform
puts 'test'
end
Thanks again for all your help.