Skip to content

Commit

Permalink
test: middleware disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Aug 7, 2023
1 parent ca48d74 commit cc43194
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/multiverse/suites/roda/roda_instrumentation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class RodaInstrumentationTest < Minitest::Test
include Rack::Test::Methods
include MultiverseHelpers

setup_and_teardown_agent

def app
RodaTestApp
end
Expand Down Expand Up @@ -95,12 +97,21 @@ def test_empty_route_name_and_response_status
assert_equal 302, txn[2][:'http.statusCode']
end

def test_roda_middleware_disabled
def test_roda_auto_middleware_disabled
with_config(:disable_roda_auto_middleware => true) do
get('/home')
txn = harvest_transaction_events![1][0]

assert_equal 'Controller/Roda/RodaTestApp/GET home', txn[0]['name']
end
txn = harvest_transaction_events![1][0]
end

assert_equal 200, txn[2][:"http.statusCode"]
def test_roda_instrumentation_works_if_middleware_disabled
with_config(:disable_middleware_instrumentation => true) do
get('/home')
txn = harvest_transaction_events![1][0]

assert_equal 'Controller/Roda/RodaTestApp/GET home', txn[0]['name']
end
end
end

0 comments on commit cc43194

Please sign in to comment.