Skip to content

Commit a50490f

Browse files
committed
WIP: repro
1 parent 6ddf4d6 commit a50490f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

sentry-rails/spec/sentry/rails/tracing_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@
5959
expect(second_span[:timestamp] - second_span[:start_timestamp]).to be_between(min_duration, max_duration)
6060
end
6161

62+
it "records correct status when Rails rescues exception to non-500 status" do
63+
get "/posts/999999"
64+
65+
expect(response).to have_http_status(:not_found)
66+
expect(transport.events.count).to eq(1)
67+
68+
transaction = transport.events.last.to_h
69+
70+
expect(transaction[:type]).to eq("transaction")
71+
72+
first_span = transaction[:spans][0]
73+
expect(first_span[:op]).to eq("view.process_action.action_controller")
74+
expect(first_span[:description]).to eq("PostsController#show")
75+
expect(first_span[:status]).to eq("not_found")
76+
expect(first_span[:data]["http.response.status_code"]).to eq(404)
77+
end
78+
6279
it "records transaction alone" do
6380
p = Post.create!
6481

0 commit comments

Comments
 (0)