diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:24:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:24:38 +0000 |
commit | 898e2cc1dfa88b4ac39cb4b35011f61b37f57b51 (patch) | |
tree | c6524edb6c9a43cccf93be05c36883fde1a53ee4 /spec/models/error_tracking | |
parent | b5571e6e22cdacc81f78eff5943d68c8ba220fbb (diff) | |
download | gitlab-ce-898e2cc1dfa88b4ac39cb4b35011f61b37f57b51.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/error_tracking')
-rw-r--r-- | spec/models/error_tracking/project_error_tracking_setting_spec.rb | 21 |
1 files changed, 15 insertions, 6 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 ef426661066..5b8be7914d4 100644 --- a/spec/models/error_tracking/project_error_tracking_setting_spec.rb +++ b/spec/models/error_tracking/project_error_tracking_setting_spec.rb @@ -138,8 +138,6 @@ describe ErrorTracking::ProjectErrorTrackingSetting do error: 'error message', error_type: ErrorTracking::ProjectErrorTrackingSetting::SENTRY_API_ERROR_TYPE_NON_20X_RESPONSE ) - expect(subject).to have_received(:sentry_client) - expect(sentry_client).to have_received(:list_issues) end end @@ -159,8 +157,6 @@ describe ErrorTracking::ProjectErrorTrackingSetting do error: 'Sentry API response is missing keys. key not found: "id"', error_type: ErrorTracking::ProjectErrorTrackingSetting::SENTRY_API_ERROR_TYPE_MISSING_KEYS ) - expect(subject).to have_received(:sentry_client) - expect(sentry_client).to have_received(:list_issues) end end @@ -181,8 +177,21 @@ describe ErrorTracking::ProjectErrorTrackingSetting do 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 + + context 'when sentry client raises StandardError' do + let(:sentry_client) { spy(:sentry_client) } + + 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(StandardError) + end + + it 'returns error' do + expect(result).to eq(error: 'Unexpected Error') end end end |