Skip to content

Commit

Permalink
re-establish Web UI test by stubbing time.now, #4149
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Apr 16, 2019
1 parent da05cc8 commit 0089c71
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test_web.rb
Expand Up @@ -114,6 +114,19 @@ def perform(a, b)
assert_match(/foo/, last_response.body)
refute_match(/HardWorker/, last_response.body)
assert_match(/0.0/, last_response.body)
refute_match(/datetime/, last_response.body)
Sidekiq::Queue.new("foo").clear

Time.stub(:now, Time.now - 65) do
assert Sidekiq::Client.push('queue' => :foo, 'class' => WebWorker, 'args' => [1, 3])
end

get '/queues'
assert_equal 200, last_response.status
assert_match(/foo/, last_response.body)
refute_match(/HardWorker/, last_response.body)
assert_match(/65.0/, last_response.body)
assert_match(/datetime/, last_response.body)
end

it 'handles queue view' do
Expand Down

0 comments on commit 0089c71

Please sign in to comment.