Skip to content

Commit

Permalink
test: middleware fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Aug 7, 2023
1 parent cc43194 commit 13ca306
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/multiverse/suites/roda/roda_instrumentation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class RodaTestApp < Roda
end
end

class RodaNoMiddleware < Roda; end

class RodaInstrumentationTest < Minitest::Test
include Rack::Test::Methods
include MultiverseHelpers
Expand All @@ -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')
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 13ca306

Please sign in to comment.