Commit e4b997a5 authored by Arturo Herrero's avatar Arturo Herrero

Explicit context for Jira Server spec

parent 8cc1b55f
...@@ -8,7 +8,7 @@ RSpec.describe Integrations::Jira::IssueEntity do ...@@ -8,7 +8,7 @@ RSpec.describe Integrations::Jira::IssueEntity do
let(:reporter) do let(:reporter) do
double( double(
'displayName' => 'reporter', 'displayName' => 'reporter',
'name' => 'reporter@reporter.com' 'name' => double
) )
end end
...@@ -43,10 +43,7 @@ RSpec.describe Integrations::Jira::IssueEntity do ...@@ -43,10 +43,7 @@ RSpec.describe Integrations::Jira::IssueEntity do
text_color: '#FFFFFF' text_color: '#FFFFFF'
} }
], ],
author: { author: hash_including(name: 'reporter'),
name: 'reporter',
web_url: 'http://jira.com/secure/ViewProfile.jspa?name=reporter@reporter.com'
},
assignees: [ assignees: [
{ name: 'assignee' } { name: 'assignee' }
], ],
...@@ -56,6 +53,16 @@ RSpec.describe Integrations::Jira::IssueEntity do ...@@ -56,6 +53,16 @@ RSpec.describe Integrations::Jira::IssueEntity do
) )
end end
context 'with Jira Server configuration' do
before do
allow(reporter).to receive(:name).and_return('reporter@reporter.com')
end
it 'returns the Jira Server profile URL' do
expect(subject[:author]).to include(web_url: 'http://jira.com/secure/ViewProfile.jspa?name=reporter@reporter.com')
end
end
context 'with Jira Cloud configuration' do context 'with Jira Cloud configuration' do
before do before do
allow(reporter).to receive(:accountId).and_return('12345') allow(reporter).to receive(:accountId).and_return('12345')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment