File tree Expand file tree Collapse file tree
sentry-rails/spec/sentry/rails Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments