diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 03:06:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 03:06:21 +0300 |
commit | 75687c79df805b57914d79cf217e3f08dbc77cc2 (patch) | |
tree | bff07aefc6467b8a7e00cd7649109fc6e8b7768f /spec/models/error_tracking/project_error_tracking_setting_spec.rb | |
parent | 0c3f12149372a79b825d265a6c28dc547e4a1afc (diff) |
Add latest changes from gitlab-org/gitlab@master
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.rb | 22 |
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 |