Skip to content
Browse files

Update tests

  • Loading branch information...
1 parent 6e97643 commit a7b418e31a63835f87528e84169bf339f428623c @krasnoukhov committed Dec 24, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 test/test_unique_jobs.rb
View
10 test/test_unique_jobs.rb
@@ -63,19 +63,21 @@ def perform(x)
it 'allows the job to reschedule itself with enabled forever option' do
5.times {
msg = Sidekiq.dump_json('class' => UniqueScheduledWorker.to_s, 'args' => ['something'])
- @boss.expect(:processor_done!, nil, [@processor])
+ actor = MiniTest::Mock.new
+ actor.expect(:processor_done, nil, [@processor])
+ @boss.expect(:async, actor, [])
@processor.process(msg, 'default')
- @boss.verify
}
assert_equal 1, Sidekiq.redis { |c| c.zcard('schedule') }
end
it 'discards non critical information about the message' do
5.times {|i|
msg = Sidekiq.dump_json('class' => UniqueScheduledWorker.to_s, 'args' => ['something'], 'sent_at' => (Time.now + i*60).to_f)
- @boss.expect(:processor_done!, nil, [@processor])
+ actor = MiniTest::Mock.new
+ actor.expect(:processor_done, nil, [@processor])
+ @boss.expect(:async, actor, [])
@processor.process(msg, 'default')
- @boss.verify
}
assert_equal 1, Sidekiq.redis { |c| c.zcard('schedule') }
end

0 comments on commit a7b418e

Please sign in to comment.
Something went wrong with that request. Please try again.