Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-11 00:11:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-11 00:11:20 +0300
commit9fee94931194cf43bbf804356a75226b282227f7 (patch)
treedf3303f3103683fa442dcebf86b1d79996365754 /spec/lib/gitlab/error_tracking_spec.rb
parentca5de528358c23e9cfcb0ff0f42c4106310c3811 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/error_tracking_spec.rb')
-rw-r--r--spec/lib/gitlab/error_tracking_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/error_tracking_spec.rb b/spec/lib/gitlab/error_tracking_spec.rb
index 7ad1f52780a..6f706ac7888 100644
--- a/spec/lib/gitlab/error_tracking_spec.rb
+++ b/spec/lib/gitlab/error_tracking_spec.rb
@@ -215,6 +215,16 @@ RSpec.describe Gitlab::ErrorTracking do
expect(sentry_event.dig('extra', 'sql')).to eq('SELECT "users".* FROM "users" WHERE "users"."id" = $2 AND "users"."foo" = $1')
end
end
+
+ context 'when the `ActiveRecord::StatementInvalid` is a bad query' do
+ it 'injects the query as-is into extra' do
+ allow(exception).to receive(:cause).and_return(ActiveRecord::StatementInvalid.new(sql: 'SELECT SELECT FROM SELECT'))
+
+ track_exception
+
+ expect(sentry_event.dig('extra', 'sql')).to eq('SELECT SELECT FROM SELECT')
+ end
+ end
end
context 'event processors' do