summaryrefslogtreecommitdiff
path: root/spec/lib/sentry
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 12:08:16 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 12:08:16 +0000
commit1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69 (patch)
treeffdfbd9113743831ff4f1290959a62cf6567fde5 /spec/lib/sentry
parent82fa8a3d1e8466ef36b58604d20fcc145ea12118 (diff)
downloadgitlab-ce-1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/sentry')
-rw-r--r--spec/lib/sentry/client/issue_spec.rb28
1 files changed, 28 insertions, 0 deletions
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,
+ '',
+ "<a href=\"http://github.com/issues/6\">github-issue-6</a>",
+ "<div>annotation</a>",
+ "<a href=\"http://localhost/gitlab-org/gitlab/issues/2\">gitlab-org/gitlab#2</a>"
+ ]
+ 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