diff options
Diffstat (limited to 'spec/models/integrations/jira_spec.rb')
-rw-r--r-- | spec/models/integrations/jira_spec.rb | 30 |
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 |