summaryrefslogtreecommitdiff
path: root/spec/models/error_tracking/project_error_tracking_setting_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
commit5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch)
treee5df8e0ceee60f4af8093f5c4c2f934b8abced05 /spec/models/error_tracking/project_error_tracking_setting_spec.rb
parent4d477238500c347c6553d335d920bedfc5a46869 (diff)
downloadgitlab-ce-5a8431feceba47fd8e1804d9aa1b1730606b71d5.tar.gz
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'spec/models/error_tracking/project_error_tracking_setting_spec.rb')
-rw-r--r--spec/models/error_tracking/project_error_tracking_setting_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/error_tracking/project_error_tracking_setting_spec.rb b/spec/models/error_tracking/project_error_tracking_setting_spec.rb
index 21e381d9fb7..dbd3f8ffab3 100644
--- a/spec/models/error_tracking/project_error_tracking_setting_spec.rb
+++ b/spec/models/error_tracking/project_error_tracking_setting_spec.rb
@@ -208,6 +208,28 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
expect(sentry_client).to have_received(:list_issues)
end
end
+
+ context 'when sentry client raises Sentry::Client::ResponseInvalidSizeError' do
+ let(:sentry_client) { spy(:sentry_client) }
+ let(:error_msg) {"Sentry API response is too big. Limit is #{Gitlab::Utils::DeepSize.human_default_max_size}."}
+
+ before do
+ synchronous_reactive_cache(subject)
+
+ allow(subject).to receive(:sentry_client).and_return(sentry_client)
+ allow(sentry_client).to receive(:list_issues).with(opts)
+ .and_raise(Sentry::Client::ResponseInvalidSizeError, error_msg)
+ end
+
+ it 'returns error' do
+ expect(result).to eq(
+ error: error_msg,
+ error_type: ErrorTracking::ProjectErrorTrackingSetting::SENTRY_API_ERROR_INVALID_SIZE
+ )
+ expect(subject).to have_received(:sentry_client)
+ expect(sentry_client).to have_received(:list_issues)
+ end
+ end
end
describe '#list_sentry_projects' do