summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_import_test.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-02-20 18:12:42 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-02-20 18:12:42 +0000
commit3e9f0023a197c39109292c52507b1749cb7d4e6c (patch)
tree39c015a39549c7ee46fdcc3af21b8eb5f52fa261 /test/unit/issue_import_test.rb
parentd8f8b7d4963119ce06235160ac14a280d27f5508 (diff)
downloadredmine-3e9f0023a197c39109292c52507b1749cb7d4e6c.tar.gz
redmine-3e9f0023a197c39109292c52507b1749cb7d4e6c.zip
Fix import with issue relations and invalid issues hangs without any error message in UI (#35656).
git-svn-id: http://svn.redmine.org/redmine/trunk@21422 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r--test/unit/issue_import_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb
index 79038ace4..bb0fa96ec 100644
--- a/test/unit/issue_import_test.rb
+++ b/test/unit/issue_import_test.rb
@@ -273,6 +273,28 @@ class IssueImportTest < ActiveSupport::TestCase
assert_equal Date.new(2020, 2, 3), third.due_date
end
+ def test_import_with_relations_and_invalid_issue_should_not_fail
+ import = generate_import_with_mapping('import_issues_with_relation_and_invalid_issues.csv')
+ import.settings['mapping'] = {
+ 'project_id' => '1',
+
+ 'tracker' => '1',
+ 'subject' => '2',
+ 'status' => '3',
+ 'relation_relates' => '4',
+ }
+ import.save!
+
+ first, second, third, fourth = new_records(Issue, 4) {import.run}
+
+ assert_equal 1, import.unsaved_items.count
+ item = import.unsaved_items.first
+ assert_include "Subject cannot be blank", item.message
+
+ assert_equal 1, first.relations_from.count
+ assert_equal 1, second.relations_to.count
+ end
+
def test_assignee_should_be_set
import = generate_import_with_mapping
import.mapping['assigned_to'] = '11'