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