Skip to content

Commit

Permalink
Use a constant in rack http route specs
Browse files Browse the repository at this point in the history
  • Loading branch information
y9v committed Aug 30, 2024
1 parent d5bbc94 commit 4b6f5ed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec/datadog/tracing/contrib/rack/http_route_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,24 @@
response = get('/hello/world')

expect(response).to be_ok
expect(request_span.get_tag('http.route')).to eq('/hello/world')
expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_ROUTE))
.to eq('/hello/world')
end

it 'sets http.route tag on request to nested app route' do
response = get('/rack/hello/world')

expect(response).to be_ok
expect(request_span.get_tag('http.route')).to eq('/rack/hello/world')
expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_ROUTE))
.to eq('/rack/hello/world')
end

it 'sets no http.route tag when response status is 404' do
response = get('/no_route')

expect(response).to be_not_found
expect(request_span.get_tag('http.route')).to be_nil
expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_ROUTE))
.to be_nil
end

def request_span
Expand Down

0 comments on commit 4b6f5ed

Please sign in to comment.