From a50490f7654ac6b115effbac336713f417c7c1d8 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 2 Feb 2026 20:12:54 +0000 Subject: [PATCH] WIP: repro --- sentry-rails/spec/sentry/rails/tracing_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sentry-rails/spec/sentry/rails/tracing_spec.rb b/sentry-rails/spec/sentry/rails/tracing_spec.rb index aee2c38f9..c2fbf8032 100644 --- a/sentry-rails/spec/sentry/rails/tracing_spec.rb +++ b/sentry-rails/spec/sentry/rails/tracing_spec.rb @@ -59,6 +59,23 @@ expect(second_span[:timestamp] - second_span[:start_timestamp]).to be_between(min_duration, max_duration) end + it "records correct status when Rails rescues exception to non-500 status" do + get "/posts/999999" + + expect(response).to have_http_status(:not_found) + expect(transport.events.count).to eq(1) + + transaction = transport.events.last.to_h + + expect(transaction[:type]).to eq("transaction") + + first_span = transaction[:spans][0] + expect(first_span[:op]).to eq("view.process_action.action_controller") + expect(first_span[:description]).to eq("PostsController#show") + expect(first_span[:status]).to eq("not_found") + expect(first_span[:data]["http.response.status_code"]).to eq(404) + end + it "records transaction alone" do p = Post.create!