Skip to content

Commit

Permalink
Fix Rack deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Apr 25, 2024
1 parent e57a47e commit b554667
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/web_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def job_params(job, score)
params = add_retry
post "/retries", "key" => [job_params(*params)], "delete" => "Delete"
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]

get "/retries"
assert_equal 200, last_response.status
Expand All @@ -380,7 +380,7 @@ def job_params(job, score)
params = add_retry
post "/retries/#{job_params(*params)}", "delete" => "Delete"
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]

get "/retries"
assert_equal 200, last_response.status
Expand All @@ -393,7 +393,7 @@ def job_params(job, score)
post "/retries/all/delete", "delete" => "Delete"
assert_equal 0, Sidekiq::RetrySet.new.size
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]
end

it "can kill all retries" do
Expand All @@ -403,14 +403,14 @@ def job_params(job, score)
assert_equal 0, Sidekiq::RetrySet.new.size
assert_equal 3, Sidekiq::DeadSet.new.size
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]
end

it "can retry a single retry now" do
params = add_retry
post "/retries/#{job_params(*params)}", "retry" => "Retry"
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]

get "/queues/default"
assert_equal 200, last_response.status
Expand All @@ -421,7 +421,7 @@ def job_params(job, score)
params = add_retry
post "/retries/#{job_params(*params)}", "kill" => "Kill"
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]

get "/morgue"
assert_equal 200, last_response.status
Expand Down Expand Up @@ -487,7 +487,7 @@ def job_params(job, score)
params = add_scheduled
post "/scheduled/#{job_params(*params)}", "add_to_queue" => true
assert_equal 302, last_response.status
assert_equal "http://example.org/scheduled", last_response.header["Location"]
assert_equal "http://example.org/scheduled", last_response.headers["Location"]

get "/queues/default"
assert_equal 200, last_response.status
Expand All @@ -498,7 +498,7 @@ def job_params(job, score)
params = add_scheduled
post "/scheduled/#{job_params(*params)}", "delete" => "Delete"
assert_equal 302, last_response.status
assert_equal "http://example.org/scheduled", last_response.header["Location"]
assert_equal "http://example.org/scheduled", last_response.headers["Location"]

get "/scheduled"
assert_equal 200, last_response.status
Expand All @@ -511,7 +511,7 @@ def job_params(job, score)
assert_equal 1, conn.zcard("schedule")
post "/scheduled", "key" => [job_params(*params)], "delete" => "Delete"
assert_equal 302, last_response.status
assert_equal "http://example.org/scheduled", last_response.header["Location"]
assert_equal "http://example.org/scheduled", last_response.headers["Location"]
assert_equal 0, conn.zcard("schedule")
end
end
Expand All @@ -524,7 +524,7 @@ def job_params(job, score)
assert_equal 0, q.size
post "/scheduled", "key" => [job_params(*params)], "add_to_queue" => "AddToQueue"
assert_equal 302, last_response.status
assert_equal "http://example.org/scheduled", last_response.header["Location"]
assert_equal "http://example.org/scheduled", last_response.headers["Location"]
assert_equal 0, conn.zcard("schedule")
assert_equal 1, q.size
get "/queues/default"
Expand All @@ -539,7 +539,7 @@ def job_params(job, score)

post "/retries/all/retry", "retry" => "Retry"
assert_equal 302, last_response.status
assert_equal "http://example.org/retries", last_response.header["Location"]
assert_equal "http://example.org/retries", last_response.headers["Location"]
assert_equal 2, Sidekiq::Queue.new("default").size

get "/queues/default"
Expand Down Expand Up @@ -641,7 +641,7 @@ def job_params(job, score)
it "redirects to stats" do
get "/dashboard/stats"
assert_equal 302, last_response.status
assert_equal "http://example.org/stats", last_response.header["Location"]
assert_equal "http://example.org/stats", last_response.headers["Location"]
end
end

Expand Down Expand Up @@ -737,7 +737,7 @@ def job_params(job, score)
params = add_dead
post "/morgue", "key" => [job_params(*params)], "delete" => "Delete"
assert_equal 302, last_response.status
assert_equal "http://example.org/morgue", last_response.header["Location"]
assert_equal "http://example.org/morgue", last_response.headers["Location"]

get "/morgue"
assert_equal 200, last_response.status
Expand All @@ -751,7 +751,7 @@ def job_params(job, score)
post "/morgue/all/delete"
assert_equal 0, Sidekiq::DeadSet.new.size
assert_equal 302, last_response.status
assert_equal "http://example.org/morgue", last_response.header["Location"]
assert_equal "http://example.org/morgue", last_response.headers["Location"]
end

it "can filter dead" do
Expand Down Expand Up @@ -783,7 +783,7 @@ def job_params(job, score)
assert_equal 0, Sidekiq::DeadSet.new.size
assert_equal 3, Sidekiq::Queue.new("foo").size
assert_equal 302, last_response.status
assert_equal "http://example.org/morgue", last_response.header["Location"]
assert_equal "http://example.org/morgue", last_response.headers["Location"]
end

it "can display a dead job" do
Expand All @@ -796,7 +796,7 @@ def job_params(job, score)
params = add_dead
post "/morgue/#{job_params(*params)}", "retry" => "Retry"
assert_equal 302, last_response.status
assert_equal "http://example.org/morgue", last_response.header["Location"]
assert_equal "http://example.org/morgue", last_response.headers["Location"]
assert_equal 0, Sidekiq::DeadSet.new.size

params = add_dead("jid-with-hyphen")
Expand Down Expand Up @@ -912,7 +912,7 @@ def app
get "/"

assert_equal 401, last_response.status
refute_nil last_response.header["WWW-Authenticate"]
refute_nil last_response.headers["WWW-Authenticate"]
end

it "authenticates successfully" do
Expand Down

0 comments on commit b554667

Please sign in to comment.