mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Fix tests
This commit is contained in:
parent
5a81d23605
commit
1624388af6
2 changed files with 3 additions and 2 deletions
|
@ -282,7 +282,7 @@ class TestWeb < Sidekiq::Test
|
||||||
Sidekiq.redis do |conn|
|
Sidekiq.redis do |conn|
|
||||||
pro = 'foo:1234'
|
pro = 'foo:1234'
|
||||||
conn.sadd('processes', pro)
|
conn.sadd('processes', pro)
|
||||||
conn.hmset(pro, 'info', Sidekiq.dump_json('started_at' => Time.now.to_f), 'busy', 1, 'beat', Time.now.to_f)
|
conn.hmset(pro, 'info', Sidekiq.dump_json('started_at' => Time.now.to_f, 'labels' => ['frumduz']), 'busy', 1, 'beat', Time.now.to_f)
|
||||||
identity = "#{pro}:workers"
|
identity = "#{pro}:workers"
|
||||||
hash = {:queue => 'critical', :payload => { 'class' => "FailWorker", 'args' => ["<a>hello</a>"] }, :run_at => Time.now.to_i }
|
hash = {:queue => 'critical', :payload => { 'class' => "FailWorker", 'args' => ["<a>hello</a>"] }, :run_at => Time.now.to_i }
|
||||||
conn.hmset(identity, 100001, Sidekiq.dump_json(hash))
|
conn.hmset(identity, 100001, Sidekiq.dump_json(hash))
|
||||||
|
@ -292,6 +292,7 @@ class TestWeb < Sidekiq::Test
|
||||||
get '/busy'
|
get '/busy'
|
||||||
assert_equal 200, last_response.status
|
assert_equal 200, last_response.status
|
||||||
assert_match(/FailWorker/, last_response.body)
|
assert_match(/FailWorker/, last_response.body)
|
||||||
|
assert_match(/frumduz/, last_response.body)
|
||||||
assert last_response.body.include?( "<a>hello</a>" )
|
assert last_response.body.include?( "<a>hello</a>" )
|
||||||
assert !last_response.body.include?( "<a>hello</a>" )
|
assert !last_response.body.include?( "<a>hello</a>" )
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<%= "#{process['hostname']}:#{process['pid']}" %>
|
<%= "#{process['hostname']}:#{process['pid']}" %>
|
||||||
<% process['labels'].each do |label| %>
|
<% Array(process['labels']).each do |label| %>
|
||||||
<span class="label label-info"><%= label %></span>
|
<span class="label label-info"><%= label %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Add table
Reference in a new issue