diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 00:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 00:07:48 +0300 |
commit | e98d69bc8b8b926a727d36e37d2ee30c9fa28907 (patch) | |
tree | 1e86398c19b6ddd0602a99fb449cf75652ac62cf /spec/models/error_tracking | |
parent | 007aba8b3b5583c5ef31670369f32f9f1f72555d (diff) |
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 | 34 |
1 files changed, 34 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 5b8be7914d4..03e4c04f97e 100644 --- a/spec/models/error_tracking/project_error_tracking_setting_spec.rb +++ b/spec/models/error_tracking/project_error_tracking_setting_spec.rb @@ -210,6 +210,40 @@ describe ErrorTracking::ProjectErrorTrackingSetting do end end + describe '#update_issue' do + let(:opts) do + { status: 'resolved' } + end + + let(:result) do + subject.update_issue(**opts) + end + + let(:sentry_client) { spy(:sentry_client) } + + context 'successful call to sentry' do + before do + allow(subject).to receive(:sentry_client).and_return(sentry_client) + allow(sentry_client).to receive(:update_issue).with(opts).and_return(true) + end + + it 'returns the successful response' do + expect(result).to eq(updated: true) + end + end + + context 'sentry raises an error' do + before do + allow(subject).to receive(:sentry_client).and_return(sentry_client) + allow(sentry_client).to receive(:update_issue).with(opts).and_raise(StandardError) + end + + it 'returns the successful response' do + expect(result).to eq(error: 'Unexpected Error') + end + end + end + context 'slugs' do shared_examples_for 'slug from api_url' do |method, slug| context 'when api_url is correct' do |