Fix tests with Ruby 3

This commit is contained in:
Rafael Mendonça França 2020-10-30 02:20:04 +00:00
parent e14e78bf44
commit a09b04e637
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
1 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ require "abstract_unit"
class RequestIdTest < ActiveSupport::TestCase
test "passing on the request id from the outside" do
assert_equal "external-uu-rid", stub_request("HTTP_X_REQUEST_ID" => "external-uu-rid").request_id
assert_equal "external-uu-rid", stub_request({ "HTTP_X_REQUEST_ID" => "external-uu-rid" }).request_id
end
test "passing on the request id via a configured header" do
@ -12,16 +12,16 @@ class RequestIdTest < ActiveSupport::TestCase
end
test "ensure that only alphanumeric uurids are accepted" do
assert_equal "X-Hacked-HeaderStuff", stub_request("HTTP_X_REQUEST_ID" => "; X-Hacked-Header: Stuff").request_id
assert_equal "X-Hacked-HeaderStuff", stub_request({ "HTTP_X_REQUEST_ID" => "; X-Hacked-Header: Stuff" }).request_id
end
test "accept Apache mod_unique_id format" do
mod_unique_id = "abcxyz@ABCXYZ-0123456789"
assert_equal mod_unique_id, stub_request("HTTP_X_REQUEST_ID" => mod_unique_id).request_id
assert_equal mod_unique_id, stub_request({ "HTTP_X_REQUEST_ID" => mod_unique_id }).request_id
end
test "ensure that 255 char limit on the request id is being enforced" do
assert_equal "X" * 255, stub_request("HTTP_X_REQUEST_ID" => "X" * 500).request_id
assert_equal "X" * 255, stub_request({ "HTTP_X_REQUEST_ID" => "X" * 500 }).request_id
end
test "generating a request id when none is supplied" do
@ -29,7 +29,7 @@ class RequestIdTest < ActiveSupport::TestCase
end
test "uuid alias" do
assert_equal "external-uu-rid", stub_request("HTTP_X_REQUEST_ID" => "external-uu-rid").uuid
assert_equal "external-uu-rid", stub_request({ "HTTP_X_REQUEST_ID" => "external-uu-rid" }).uuid
end
private