From 13ca3067bcb9dfc42aabc4ea90c566ec750ef924 Mon Sep 17 00:00:00 2001 From: hramadan Date: Mon, 7 Aug 2023 14:43:29 -0700 Subject: [PATCH] test: middleware fix --- .../suites/roda/roda_instrumentation_test.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/multiverse/suites/roda/roda_instrumentation_test.rb b/test/multiverse/suites/roda/roda_instrumentation_test.rb index 7d259c5cba..d387984b0a 100644 --- a/test/multiverse/suites/roda/roda_instrumentation_test.rb +++ b/test/multiverse/suites/roda/roda_instrumentation_test.rb @@ -34,6 +34,8 @@ class RodaTestApp < Roda end end +class RodaNoMiddleware < Roda; end + class RodaInstrumentationTest < Minitest::Test include Rack::Test::Methods include MultiverseHelpers @@ -44,6 +46,10 @@ def app RodaTestApp end + def app2 + RodaNoMiddleware + end + def test_nil_verb NewRelic::Agent::Instrumentation::Roda::TransactionNamer.stub(:http_verb, nil) do get('/home') @@ -99,10 +105,9 @@ def test_empty_route_name_and_response_status def test_roda_auto_middleware_disabled with_config(:disable_roda_auto_middleware => true) do - get('/home') - txn = harvest_transaction_events![1][0] + RodaNoMiddleware.build_rack_app_with_tracing {} - assert_equal 'Controller/Roda/RodaTestApp/GET home', txn[0]['name'] + assert_truthy NewRelic::Agent::Agent::config[:disable_roda_auto_middleware] end end