From 3a41c8b2ea94ee17f5557e30512123883fb93e85 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Mon, 21 Aug 2023 16:03:06 -0700 Subject: [PATCH] update tests to assert status code is now recorded when middleware instrumentation is disabled --- test/multiverse/suites/rack/http_response_code_test.rb | 6 +++--- test/multiverse/suites/rack/response_content_type_test.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/multiverse/suites/rack/http_response_code_test.rb b/test/multiverse/suites/rack/http_response_code_test.rb index 61800fbf0e..6a767b681f 100644 --- a/test/multiverse/suites/rack/http_response_code_test.rb +++ b/test/multiverse/suites/rack/http_response_code_test.rb @@ -35,17 +35,17 @@ def test_records_http_response_code_on_analytics_events assert_equal(302, get_last_analytics_event[2][:'http.statusCode']) end - def test_skips_http_response_code_if_middleware_tracing_disabled + def test_records_http_response_code_if_middleware_tracing_disabled with_config(:disable_middleware_instrumentation => true) do rsp = get('/', {'override-response-code' => 404}) assert_equal(404, rsp.status) - refute get_last_analytics_event[2][:'http.statusCode'] + assert get_last_analytics_event[2][:'http.statusCode'] rsp = get('/', {'override-response-code' => 302}) assert_equal(302, rsp.status) - refute get_last_analytics_event[2][:'http.statusCode'] + assert get_last_analytics_event[2][:'http.statusCode'] end end end diff --git a/test/multiverse/suites/rack/response_content_type_test.rb b/test/multiverse/suites/rack/response_content_type_test.rb index 69a10b47d4..8b389c4b7a 100644 --- a/test/multiverse/suites/rack/response_content_type_test.rb +++ b/test/multiverse/suites/rack/response_content_type_test.rb @@ -35,17 +35,17 @@ def test_records_response_content_type_on_analytics_events assert_equal('application/xml', get_last_analytics_event[2][:'response.headers.contentType']) end - def test_skips_response_content_type_if_middleware_tracing_disabled + def test_records_response_content_type_if_middleware_tracing_disabled with_config(:disable_middleware_instrumentation => true) do rsp = get('/', {'override-content-type' => 'application/json'}) assert_equal('application/json', rsp.headers['Content-Type']) - refute get_last_analytics_event[2][:'response.headers.contentType'] + assert get_last_analytics_event[2][:'response.headers.contentType'] rsp = get('/', {'override-content-type' => 'application/xml'}) assert_equal('application/xml', rsp.headers['Content-Type']) - refute get_last_analytics_event[2][:'response.headers.contentType'] + assert get_last_analytics_event[2][:'response.headers.contentType'] end end end