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:
parent
c59c580e43
commit
16a6eb8783
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue