diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-21 09:08:40 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-21 09:08:40 +0000 |
commit | 9c645719ee96b182a2fbe3f77129c1fdb4428791 (patch) | |
tree | 9dd09039233ab4ce5fe15c9161647cac6820388c /test/unit/issue_import_test.rb | |
parent | 83bc9d2315f55f9e9982654b874edc86353d631d (diff) | |
download | redmine-9c645719ee96b182a2fbe3f77129c1fdb4428791.tar.gz redmine-9c645719ee96b182a2fbe3f77129c1fdb4428791.zip |
Allow forward reference to parent when importing issues (#22701).
git-svn-id: http://svn.redmine.org/redmine/trunk@16241 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r-- | test/unit/issue_import_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb index 9f238cafe..8a0d24366 100644 --- a/test/unit/issue_import_test.rb +++ b/test/unit/issue_import_test.rb @@ -115,6 +115,19 @@ class IssueImportTest < ActiveSupport::TestCase assert_equal 2, issues[2].parent_id end + def test_backward_and_forward_reference_to_parent_should_work + import = generate_import('import_subtasks.csv') + import.settings = { + 'separator' => ";", 'wrapper' => '"', 'encoding' => "UTF-8", + 'mapping' => {'project_id' => '1', 'tracker' => '1', 'subject' => '2', 'parent_issue_id' => '3'} + } + import.save! + + root, child1, grandchild, child2 = new_records(Issue, 4) { import.run } + assert_equal root, child1.parent + assert_equal child2, grandchild.parent + end + def test_assignee_should_be_set import = generate_import_with_mapping import.mapping.merge!('assigned_to' => '11') |