Reputation: 1748
In resque-scheduler
, how do I rspec-test that some job is queued EVERY 30 seconds?
Here is my resque-scheduler.yml
file:
hipchat_schedule:
queue: hipchat
every: 30s
class: HipChatPolling
There is very useful resque_spec gem, but I am not sure if it can do test for every
-clause.
Upvotes: 4
Views: 1686
Reputation: 1265
First, I think this is tested - and have to be tested - by resque-scheduler
gem (or to be precise, in the rufus-scheduler
gem), not on your side. If scheduling is not happened then it is not a bug in your application, but a bug in the gem.
But, if you want to test it anyway, you have two way to do it:
Note, to do this, you have to be sure Resque.inline
setting is disabled before the test!
Upvotes: 3