@@ -90,7 +90,7 class IssueImport < Import | |||
|
90 | 90 | end |
|
91 | 91 | end |
|
92 | 92 | if assignee_name = row_value(row, 'assigned_to') |
|
93 |
if assignee = issue.assignable_users |
|
|
93 | if assignee = Principal.detect_by_keyword(issue.assignable_users, assignee_name) | |
|
94 | 94 | attributes['assigned_to_id'] = assignee.id |
|
95 | 95 | end |
|
96 | 96 | end |
@@ -1,4 +1,4 | |||
|
1 | priority;subject;description;start_date;due_date;parent;private;progress;custom;version;category | |
|
2 | High;First;First description;2015-07-08;2015-08-25;;no;;PostgreSQL;;New category | |
|
3 | Normal;Child 1;Child description;;;1;yes;10;MySQL;2.0;New category | |
|
4 | Normal;Child of existing issue;Child description;;;#2;no;20;;2.1;Printing | |
|
1 | priority;subject;description;start_date;due_date;parent;private;progress;custom;version;category;user | |
|
2 | High;First;First description;2015-07-08;2015-08-25;;no;;PostgreSQL;;New category;dlopper | |
|
3 | Normal;Child 1;Child description;;;1;yes;10;MySQL;2.0;New category; | |
|
4 | Normal;Child of existing issue;Child description;;;#2;no;20;;2.1;Printing; |
@@ -69,6 +69,15 class IssueImportTest < ActiveSupport::TestCase | |||
|
69 | 69 | assert_equal 2, issues[2].parent_id |
|
70 | 70 | end |
|
71 | 71 | |
|
72 | def test_assignee_should_be_set | |
|
73 | import = generate_import_with_mapping | |
|
74 | import.mapping.merge!('assigned_to' => '11') | |
|
75 | import.save! | |
|
76 | ||
|
77 | issues = new_records(Issue, 3) { import.run } | |
|
78 | assert_equal [User.find(3), nil, nil], issues.map(&:assigned_to) | |
|
79 | end | |
|
80 | ||
|
72 | 81 | def test_is_private_should_be_set_based_on_user_locale |
|
73 | 82 | import = generate_import_with_mapping |
|
74 | 83 | import.mapping.merge!('is_private' => '6') |
General Comments 0
You need to be logged in to leave comments.
Login now