Commit 489b42f0 authored by Valery Sizov's avatar Valery Sizov

[Multiple Issue Assignees] Fix of issues export[ci skip]

parent d754c1fa
...@@ -21,7 +21,7 @@ module Issues ...@@ -21,7 +21,7 @@ module Issues
def csv_builder def csv_builder
@csv_builder ||= @csv_builder ||=
CsvBuilder.new(@issues.includes(:author, :assignee), header_to_value_hash) CsvBuilder.new(@issues.includes(:author, :assignees), header_to_value_hash)
end end
private private
...@@ -35,8 +35,8 @@ module Issues ...@@ -35,8 +35,8 @@ module Issues
'Description' => 'description', 'Description' => 'description',
'Author' => 'author_name', 'Author' => 'author_name',
'Author Username' => -> (issue) { issue.author&.username }, 'Author Username' => -> (issue) { issue.author&.username },
'Assignee' => 'assignee_name', 'Assignee' => -> (issue) { issue.assignees.pluck(:name).join(', ') },
'Assignee Username' => -> (issue) { issue.assignee_list }, 'Assignee Username' => -> (issue) { issue.assignees.pluck(:username).join(', ') },
'Confidential' => -> (issue) { issue.confidential? ? 'Yes' : 'No' }, 'Confidential' => -> (issue) { issue.confidential? ? 'Yes' : 'No' },
'Due Date' => -> (issue) { issue.due_date&.to_s(:csv) }, 'Due Date' => -> (issue) { issue.due_date&.to_s(:csv) },
'Created At (UTC)' => -> (issue) { issue.created_at&.to_s(:csv) }, 'Created At (UTC)' => -> (issue) { issue.created_at&.to_s(:csv) },
......
...@@ -33,7 +33,7 @@ describe Issues::ExportCsvService, services: true do ...@@ -33,7 +33,7 @@ describe Issues::ExportCsvService, services: true do
before do before do
issue.update!(milestone: milestone, issue.update!(milestone: milestone,
assignee: user, assignees: [user],
description: 'Issue with details', description: 'Issue with details',
state: :reopened, state: :reopened,
due_date: DateTime.new(2014, 3, 2), due_date: DateTime.new(2014, 3, 2),
...@@ -71,11 +71,11 @@ describe Issues::ExportCsvService, services: true do ...@@ -71,11 +71,11 @@ describe Issues::ExportCsvService, services: true do
end end
specify 'assignee name' do specify 'assignee name' do
expect(csv[0]['Assignee']).to eq issue.assignee_name expect(csv[0]['Assignee']).to eq user.name
end end
specify 'assignee username' do specify 'assignee username' do
expect(csv[0]['Assignee Username']).to eq issue.assignee.username expect(csv[0]['Assignee Username']).to eq user.username
end end
specify 'confidential' do specify 'confidential' do
......
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