summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-07 18:39:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-07 18:39:44 +0000
commitf6754a0f7a37973d3f7296d0c75ac8d20204d682 (patch)
treefc8987ba536c7c005c89dfbbdc480da56d019296 /test
parent90d14b71b3656a8362d7508dd88b2aea43c6fa31 (diff)
downloadredmine-f6754a0f7a37973d3f7296d0c75ac8d20204d682.tar.gz
redmine-f6754a0f7a37973d3f7296d0c75ac8d20204d682.zip
Make Status map-able for CSV import (#22951).
git-svn-id: http://svn.redmine.org/redmine/trunk@15493 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/files/import_issues.csv8
-rw-r--r--test/unit/issue_import_test.rb9
2 files changed, 13 insertions, 4 deletions
diff --git a/test/fixtures/files/import_issues.csv b/test/fixtures/files/import_issues.csv
index 6990cb534..fa9d22665 100644
--- a/test/fixtures/files/import_issues.csv
+++ b/test/fixtures/files/import_issues.csv
@@ -1,4 +1,4 @@
-priority;subject;description;start_date;due_date;parent;private;progress;custom;version;category;user;estimated_hours;tracker
-High;First;First description;2015-07-08;2015-08-25;;no;;PostgreSQL;;New category;dlopper;1;bug
-Normal;Child 1;Child description;;;1;yes;10;MySQL;2.0;New category;;2;feature request
-Normal;Child of existing issue;Child description;;;#2;no;20;;2.1;Printing;;3;bug
+priority;subject;description;start_date;due_date;parent;private;progress;custom;version;category;user;estimated_hours;tracker;status
+High;First;First description;2015-07-08;2015-08-25;;no;;PostgreSQL;;New category;dlopper;1;bug;new
+Normal;Child 1;Child description;;;1;yes;10;MySQL;2.0;New category;;2;feature request;new
+Normal;Child of existing issue;Child description;;;#2;no;20;;2.1;Printing;;3;bug;assigned
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb
index 6d39214d5..88da82c88 100644
--- a/test/unit/issue_import_test.rb
+++ b/test/unit/issue_import_test.rb
@@ -89,6 +89,15 @@ class IssueImportTest < ActiveSupport::TestCase
assert_include "Tracker cannot be blank", item.message
end
+ def test_status_should_be_set
+ import = generate_import_with_mapping
+ import.mapping.merge!('status' => '14')
+ import.save!
+
+ issues = new_records(Issue, 3) { import.run }
+ assert_equal ['New', 'New', 'Assigned'], issues.map(&:status).map(&:name)
+ end
+
def test_parent_should_be_set
import = generate_import_with_mapping
import.mapping.merge!('parent_issue_id' => '5')