summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_import_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-30 00:35:10 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-30 00:35:10 +0000
commit820cbe618e99d16f1842c2c9d93aad89121bd1ba (patch)
tree870ee9248de65f11c7ee81454f3fe30f4b0111df /test/unit/issue_import_test.rb
parent580e2f669a5d71435daf8e3a1060fbd69758289b (diff)
downloadredmine-820cbe618e99d16f1842c2c9d93aad89121bd1ba.tar.gz
redmine-820cbe618e99d16f1842c2c9d93aad89121bd1ba.zip
Support "YYYY/MM/DD" date format when importing issues (#31450).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18205 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r--test/unit/issue_import_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb
index eb0cef006..7f66481fc 100644
--- a/test/unit/issue_import_test.rb
+++ b/test/unit/issue_import_test.rb
@@ -215,6 +215,15 @@ class IssueImportTest < ActiveSupport::TestCase
assert_equal Date.parse('2015-07-10'), issue.start_date
assert_equal Date.parse('2015-08-12'), issue.due_date
assert_equal '2015-07-14', issue.custom_field_value(field)
+
+ # Tests using other date formats
+ import = generate_import_with_mapping('import_dates_ja.csv')
+ import.settings.merge!('date_format' => Import::DATE_FORMATS[3])
+ import.mapping.merge!('tracker' => 'value:1', 'subject' => '0', 'start_date' => '1')
+ import.save!
+
+ issue = new_record(Issue) { import.run }
+ assert_equal Date.parse('2019-05-28'), issue.start_date
end
def test_date_format_should_default_to_user_language