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

Better testing for worker page

This commit is contained in:
Mike Perham 2013-04-22 14:14:19 -07:00
parent c59c580e43
commit 16a6eb8783

View file

@ -29,9 +29,19 @@ class TestWeb < MiniTest::Unit::TestCase
end
it 'can display workers' do
Sidekiq.redis do |conn|
identity = 'foo:1234-123abc:default'
conn.sadd('workers', identity)
conn.setex("worker:#{identity}:started", 10, Time.now.to_s)
hash = {:queue => 'critical', :payload => { 'class' => WebWorker.name, 'args' => [1,'abc'] }, :run_at => Time.now.to_i }
conn.setex("worker:#{identity}", 10, Sidekiq.dump_json(hash))
end
get '/workers'
assert_equal 200, last_response.status
assert_match /status-idle/, last_response.body
assert_match /status-active/, last_response.body
assert_match /critical/, last_response.body
assert_match /WebWorker/, last_response.body
end
it 'can display queues' do