Commit 01d38b02 authored by Valery Sizov's avatar Valery Sizov

[Multiple issue asignees] fix importers and specs for them

parent d0b64118
...@@ -122,15 +122,15 @@ module Gitlab ...@@ -122,15 +122,15 @@ module Gitlab
author_id = user_info(bug['ixPersonOpenedBy'])[:gitlab_id] || project.creator_id author_id = user_info(bug['ixPersonOpenedBy'])[:gitlab_id] || project.creator_id
issue = Issue.create!( issue = Issue.create!(
iid: bug['ixBug'], iid: bug['ixBug'],
project_id: project.id, project_id: project.id,
title: bug['sTitle'], title: bug['sTitle'],
description: body, description: body,
author_id: author_id, author_id: author_id,
assignee_id: assignee_id, assignee_ids: [assignee_id],
state: bug['fOpen'] == 'true' ? 'opened' : 'closed', state: bug['fOpen'] == 'true' ? 'opened' : 'closed',
created_at: date, created_at: date,
updated_at: DateTime.parse(bug['dtLastUpdated']) updated_at: DateTime.parse(bug['dtLastUpdated'])
) )
issue_labels = ::LabelsFinder.new(nil, project_id: project.id, title: labels).execute(skip_authorization: true) issue_labels = ::LabelsFinder.new(nil, project_id: project.id, title: labels).execute(skip_authorization: true)
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
description: description, description: description,
state: state, state: state,
author_id: author_id, author_id: author_id,
assignee_id: assignee_id, assignee_ids: [assignee_id],
created_at: raw_data.created_at, created_at: raw_data.created_at,
updated_at: raw_data.updated_at updated_at: raw_data.updated_at
} }
......
...@@ -92,13 +92,13 @@ module Gitlab ...@@ -92,13 +92,13 @@ module Gitlab
end end
issue = Issue.create!( issue = Issue.create!(
iid: raw_issue['id'], iid: raw_issue['id'],
project_id: project.id, project_id: project.id,
title: raw_issue['title'], title: raw_issue['title'],
description: body, description: body,
author_id: project.creator_id, author_id: project.creator_id,
assignee_id: assignee_id, assignee_ids: [assignee_id],
state: raw_issue['state'] == 'closed' ? 'closed' : 'opened' state: raw_issue['state'] == 'closed' ? 'closed' : 'opened'
) )
issue_labels = ::LabelsFinder.new(nil, project_id: project.id, title: labels).execute(skip_authorization: true) issue_labels = ::LabelsFinder.new(nil, project_id: project.id, title: labels).execute(skip_authorization: true)
......
...@@ -49,7 +49,7 @@ describe Gitlab::GoogleCodeImport::Importer, lib: true do ...@@ -49,7 +49,7 @@ describe Gitlab::GoogleCodeImport::Importer, lib: true do
expect(issue).not_to be_nil expect(issue).not_to be_nil
expect(issue.iid).to eq(169) expect(issue.iid).to eq(169)
expect(issue.author).to eq(project.creator) expect(issue.author).to eq(project.creator)
expect(issue.assignee).to eq(mapped_user) expect(issue.assignees).to eq([mapped_user])
expect(issue.state).to eq("closed") expect(issue.state).to eq("closed")
expect(issue.label_names).to include("Priority: Medium") expect(issue.label_names).to include("Priority: Medium")
expect(issue.label_names).to include("Status: Fixed") expect(issue.label_names).to include("Status: Fixed")
......
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