1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Add more testing around #3390

This commit is contained in:
Mike Perham 2017-03-16 11:52:58 -07:00
parent 490032fd7f
commit 5de44ac880
2 changed files with 12 additions and 4 deletions

View file

@ -308,12 +308,13 @@ class TestApi < Sidekiq::Test
refute_nil Sidekiq::ScheduledSet.new.find_job(remain_id)
end
it 'can find job by id in sorted sets' do
it 'can kill a scheduled job' do
job_id = ApiWorker.perform_in(100, 1, 'jason')
job = Sidekiq::ScheduledSet.new.find_job(job_id)
refute_nil job
assert_equal job_id, job.jid
assert_in_delta job.latency, 0.0, 0.1
ds = Sidekiq::DeadSet.new
assert_equal 0, ds.size
refute_nil job.kill
assert_equal 1, ds.size
end
it 'can remove jobs when iterating over a sorted set' do

View file

@ -547,6 +547,13 @@ class TestWeb < Sidekiq::Test
assert_equal 'http://example.org/morgue', last_response.header['Location']
end
it 'can display a dead job' do
params = add_dead
get "/morgue/#{job_params(*params)}"
assert_equal 200, last_response.status
snapshot(page, name: 'Dead Job Page')
end
it 'can retry a dead job' do
params = add_dead
post "/morgue/#{job_params(*params)}", 'retry' => 'Retry'