Skip to content

Commit

Permalink
squash: fix invalid HTTP responses in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arielvalentin committed Oct 28, 2023
1 parent f85dbe7 commit 55ef600
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
let(:rails_app) { DEFAULT_RAILS_APP }

# Clear captured spans
before { exporter.reset }
before do
exporter.reset
end

it 'sets the span name to the format: ControllerName#action' do
get '/ok'
Expand Down
4 changes: 1 addition & 3 deletions instrumentation/action_pack/test/test_helpers/app_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def initialize_app(use_exceptions_app: false, remove_rack_tracer_middleware: fal
private

def remove_rack_middleware(application)
application.middleware.delete(
OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware
)
application.middleware.delete(Rack::Events)
end

def add_exceptions_app(application)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(app, _options = {})
end

def call(env)
return [307, {}, 'Temporary Redirect'] if should_redirect?(env)
return [307, { 'Location' => '/ok', 'Content-Type' => 'text/plain' }, ['Temporary Redirect']] if should_redirect?(env)

@app.call(env)
end
Expand Down

0 comments on commit 55ef600

Please sign in to comment.