From 1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 10 Mar 2020 12:08:16 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/lib/sentry/client/issue_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'spec/lib/sentry') diff --git a/spec/lib/sentry/client/issue_spec.rb b/spec/lib/sentry/client/issue_spec.rb index 62cbfbf0b30..0f57d38d290 100644 --- a/spec/lib/sentry/client/issue_spec.rb +++ b/spec/lib/sentry/client/issue_spec.rb @@ -254,6 +254,34 @@ describe Sentry::Client::Issue do expect(subject.gitlab_issue).to eq('https://gitlab.com/gitlab-org/gitlab/issues/1') end + context 'when issue annotations exist' do + before do + issue_sample_response['annotations'] = [ + nil, + '', + "github-issue-6", + "
annotation", + "gitlab-org/gitlab#2" + ] + stub_sentry_request(sentry_request_url, body: issue_sample_response) + end + + it 'has a correct GitLab issue url' do + expect(subject.gitlab_issue).to eq('http://localhost/gitlab-org/gitlab/issues/2') + end + end + + context 'when no GitLab issue is linked' do + before do + issue_sample_response['pluginIssues'] = [] + stub_sentry_request(sentry_request_url, body: issue_sample_response) + end + + it 'does not find a GitLab issue' do + expect(subject.gitlab_issue).to be_nil + end + end + it 'has the correct tags' do expect(subject.tags).to eq({ level: issue_sample_response['level'], logger: issue_sample_response['logger'] }) end -- cgit v1.2.1