summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-08 13:05:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-08 13:05:05 +0000
commit8fa311a5de24a28d8190b0a038fb893e71184eb2 (patch)
treeae489a4ab340f24312cc1d968f74e5b22ac094d4 /spec/models
parent0fabe9336cf7cf2a31156931e716e84fc45e842f (diff)
downloadgitlab-ce-8fa311a5de24a28d8190b0a038fb893e71184eb2.tar.gz
Add latest changes from gitlab-org/gitlab@14-0-stable-ee
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/integrations/jira_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/models/integrations/jira_spec.rb b/spec/models/integrations/jira_spec.rb
index f6310866773..23ade570383 100644
--- a/spec/models/integrations/jira_spec.rb
+++ b/spec/models/integrations/jira_spec.rb
@@ -1031,6 +1031,12 @@ RSpec.describe Integrations::Jira do
expect(integration.web_url('subpath', bar: 'baz baz')).to eq('http://jira.test.com/path/subpath?bar=baz%20baz&foo=bar%20bar&nosso')
end
+ it 'returns an empty string if URL is not set' do
+ integration.url = nil
+
+ expect(integration.web_url).to eq('')
+ end
+
it 'includes Atlassian referrer for gitlab.com' do
allow(Gitlab).to receive(:com?).and_return(true)
@@ -1048,16 +1054,40 @@ RSpec.describe Integrations::Jira do
end
end
+ describe '#project_url' do
+ it 'returns the correct URL' do
+ expect(integration.project_url).to eq('http://jira.test.com/path')
+ end
+
+ it 'returns an empty string if URL is not set' do
+ integration.url = nil
+
+ expect(integration.project_url).to eq('')
+ end
+ end
+
describe '#issues_url' do
it 'returns the correct URL' do
expect(integration.issues_url).to eq('http://jira.test.com/path/browse/:id')
end
+
+ it 'returns an empty string if URL is not set' do
+ integration.url = nil
+
+ expect(integration.issues_url).to eq('')
+ end
end
describe '#new_issue_url' do
it 'returns the correct URL' do
expect(integration.new_issue_url).to eq('http://jira.test.com/path/secure/CreateIssue!default.jspa')
end
+
+ it 'returns an empty string if URL is not set' do
+ integration.url = nil
+
+ expect(integration.new_issue_url).to eq('')
+ end
end
end