Commit 63082f24 authored by Arturo Herrero's avatar Arturo Herrero

Jira Issue Detail page: Jira users with username

parent 035f790e
......@@ -79,6 +79,7 @@ module Integrations
def jira_user(user)
{
name: user['displayName'],
username: user['name'],
web_url: jira_web_url(user),
avatar_url: user['avatarUrls']['48x48']
}
......
......@@ -12,7 +12,7 @@ RSpec.describe Integrations::Jira::IssueDetailEntity do
{
'displayName' => 'reporter',
'avatarUrls' => { '48x48' => 'http://reporter.avatar' },
'name' => double
'name' => 'reporter@reporter.com'
}
end
......@@ -20,7 +20,7 @@ RSpec.describe Integrations::Jira::IssueDetailEntity do
{
'displayName' => 'assignee',
'avatarUrls' => { '48x48' => 'http://assignee.avatar' },
'name' => double
'name' => 'assignee@assignee.com'
}
end
......@@ -28,7 +28,7 @@ RSpec.describe Integrations::Jira::IssueDetailEntity do
{
'displayName' => 'comment_author',
'avatarUrls' => { '48x48' => 'http://comment_author.avatar' },
'name' => double
'name' => 'comment@author.com'
}
end
......@@ -86,11 +86,13 @@ RSpec.describe Integrations::Jira::IssueDetailEntity do
],
author: hash_including(
name: 'reporter',
username: 'reporter@reporter.com',
avatar_url: 'http://reporter.avatar'
),
assignees: [
hash_including(
name: 'assignee',
username: 'assignee@assignee.com',
avatar_url: 'http://assignee.avatar'
)
],
......@@ -100,6 +102,7 @@ RSpec.describe Integrations::Jira::IssueDetailEntity do
comments: [
hash_including(
name: 'comment_author',
username: 'comment@author.com',
avatar_url: 'http://comment_author.avatar',
note: "<p dir=\"auto\">Comment</p>",
created_at: '2020-06-25T15:50:00.000+0000'.to_datetime.utc,
......@@ -110,12 +113,6 @@ RSpec.describe Integrations::Jira::IssueDetailEntity do
end
context 'with Jira Server configuration' do
before do
reporter['name'] = 'reporter@reporter.com'
assignee['name'] = 'assignee@assignee.com'
comment_author['name'] = 'comment@author.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')
expect(subject[:assignees].first).to include(web_url: 'http://jira.com/secure/ViewProfile.jspa?name=assignee@assignee.com')
......
......@@ -12,7 +12,7 @@ RSpec.describe Integrations::Jira::IssueEntity do
{
'displayName' => 'reporter',
'avatarUrls' => { '48x48' => 'http://reporter.avatar' },
'name' => double
'name' => 'reporter@reporter.com'
}
end
......@@ -20,7 +20,7 @@ RSpec.describe Integrations::Jira::IssueEntity do
{
'displayName' => 'assignee',
'avatarUrls' => { '48x48' => 'http://assignee.avatar' },
'name' => double
'name' => 'assignee@assignee.com'
}
end
......@@ -61,11 +61,13 @@ RSpec.describe Integrations::Jira::IssueEntity do
],
author: hash_including(
name: 'reporter',
username: 'reporter@reporter.com',
avatar_url: 'http://reporter.avatar'
),
assignees: [
hash_including(
name: 'assignee',
username: 'assignee@assignee.com',
avatar_url: 'http://assignee.avatar'
)
],
......@@ -77,11 +79,6 @@ RSpec.describe Integrations::Jira::IssueEntity do
end
context 'with Jira Server configuration' do
before do
reporter['name'] = 'reporter@reporter.com'
assignee['name'] = 'assignee@assignee.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')
expect(subject[:assignees].first).to include(web_url: 'http://jira.com/secure/ViewProfile.jspa?name=assignee@assignee.com')
......
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