diff --git a/test/integration/instrumentation_test.rb b/test/integration/instrumentation_test.rb index 118585b..9e5f69c 100644 --- a/test/integration/instrumentation_test.rb +++ b/test/integration/instrumentation_test.rb @@ -6,12 +6,12 @@ class InstrumentationTest < IntegrationTest visit "/login" end - assert_match /Processing by RodauthController#login as HTML/, logged - refute_match /Parameters/, logged + assert_match(/Processing by RodauthController#login as HTML/, logged) + refute_match(/Parameters/, logged) if ::Rails.gem_version >= Gem::Version.new("6.0") - assert_match /Completed 200 OK in \d+ms \(Views: \d+ms | ActiveRecord: \d+\.\d+ms | Allocations: \d+\)/, logged + assert_match(/Completed 200 OK in \d+ms \(Views: \d+ms | ActiveRecord: \d+\.\d+ms | Allocations: \d+\)/, logged) else - assert_match /Completed 200 OK in \d+ms \(Views: \d+ms | ActiveRecord: \d+\.\d+ms\)/, logged + assert_match(/Completed 200 OK in \d+ms \(Views: \d+ms | ActiveRecord: \d+\.\d+ms\)/, logged) end end @@ -22,9 +22,9 @@ class InstrumentationTest < IntegrationTest { "CONTENT_TYPE" => "application/json", "HTTP_ACCEPT" => "application/json" } end - assert_match /Processing by ActionController::API#login as JSON/, logged - assert_match /Parameters: {"login"=>"user@example\.com", "password"=>"secret"}/, logged - assert_match /Completed 401 Unauthorized/, logged + assert_match(/Processing by ActionController::API#login as JSON/, logged) + assert_match(/Parameters: {"login" ?=> ?"user@example\.com", "password" ?=> ?"secret"}/, logged) + assert_match(/Completed 401 Unauthorized/, logged) end test "logs redirects" do @@ -32,9 +32,9 @@ class InstrumentationTest < IntegrationTest visit "/change-password" end - assert_match /Processing by RodauthController#change_password as HTML/, logged - assert_match /Redirected to \/login/, logged - assert_match /Completed 302 Found/, logged + assert_match(/Processing by RodauthController#change_password as HTML/, logged) + assert_match(/Redirected to \/login/, logged) + assert_match(/Completed 302 Found/, logged) end test "handles early response via callback" do @@ -42,8 +42,8 @@ class InstrumentationTest < IntegrationTest visit "/login?early_return=true" end - assert_match /Processing by RodauthController#login as HTML/, logged - assert_match /Completed 201 Created in \d+ms/, logged + assert_match(/Processing by RodauthController#login as HTML/, logged) + assert_match(/Completed 201 Created in \d+ms/, logged) end test "logs response status when redirecting inside controller" do @@ -51,7 +51,7 @@ class InstrumentationTest < IntegrationTest visit "/auth2" end - assert_match /Completed 302 Found/, logged + assert_match(/Completed 302 Found/, logged) end test "logs response status when halting inside controller" do @@ -59,7 +59,7 @@ class InstrumentationTest < IntegrationTest visit "/auth_json" end - assert_match /Completed 401 Unauthorized/, logged + assert_match(/Completed 401 Unauthorized/, logged) end private diff --git a/test/test_helper.rb b/test/test_helper.rb index e472bb7..10cc02f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,6 @@ ENV["RAILS_ENV"] = "test" require "warning" -Warning.ignore(:ambiguous_slash, __dir__) Gem.path.each { |path| Warning.ignore(//, path) } # ignore warnings in dependencies require "bundler/setup"