Skip to content

Commit

Permalink
update tests to assert status code is now
Browse files Browse the repository at this point in the history
recorded when middleware instrumentation is disabled
  • Loading branch information
tannalynn committed Aug 21, 2023
1 parent e6ed7fc commit 3a41c8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/multiverse/suites/rack/http_response_code_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/multiverse/suites/rack/response_content_type_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a41c8b

Please sign in to comment.