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

Add test for dashboard stat refresh.

This commit is contained in:
Brandon Hilkert 2012-12-13 06:53:54 -05:00
parent cbc6e16e7b
commit 27c772eaed

View file

@ -200,6 +200,16 @@ class TestWeb < MiniTest::Unit::TestCase
assert_equal 200, last_response.status assert_equal 200, last_response.status
end end
it 'can refresh dashboard stats' do
Sidekiq.redis do |conn|
conn.set("stat:processed", 5)
conn.set("stat:failed", 2)
end
get '/dashboard/stats'
assert_equal 200, last_response.status
assert_equal "{\"processed\":5,\"failed\":2}", last_response.body
end
def add_scheduled def add_scheduled
score = Time.now.to_f score = Time.now.to_f
msg = { 'class' => 'HardWorker', msg = { 'class' => 'HardWorker',