summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_import_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-12-20 08:07:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-12-20 08:07:57 +0000
commit13da124b16ff58f83e812e8b57f4039b4681a3d6 (patch)
treefa9b0fd654a48dc7cca7da430bf84098638bc10f /test/unit/issue_import_test.rb
parent9c6a2c48e0e5bafbe8158269f6c4969d89441e89 (diff)
downloadredmine-13da124b16ff58f83e812e8b57f4039b4681a3d6.tar.gz
redmine-13da124b16ff58f83e812e8b57f4039b4681a3d6.zip
CSV import does not keep the project it was clicked from (#21766).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19381 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r--test/unit/issue_import_test.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb
index 8404a0ec1..7068f46e3 100644
--- a/test/unit/issue_import_test.rb
+++ b/test/unit/issue_import_test.rb
@@ -266,4 +266,32 @@ class IssueImportTest < ActiveSupport::TestCase
issues = new_records(Issue, 3) { import.run }
assert [nil, 3, system_version.id], issues.map(&:fixed_version_id)
end
+
+ def test_set_default_settings_with_project_id
+ import = Import.new
+ import.set_default_settings(:project_id => 3)
+
+ assert_equal 3, import.mapping['project_id']
+ end
+
+ def test_set_default_settings_with_project_identifier
+ import = Import.new
+ import.set_default_settings(:project_id => 'ecookbook')
+
+ assert_equal 1, import.mapping['project_id']
+ end
+
+ def test_set_default_settings_without_project_id
+ import = Import.new
+ import.set_default_settings
+
+ assert_empty import.mapping
+ end
+
+ def test_set_default_settings_with_invalid_project_should_not_fail
+ import = Import.new
+ import.set_default_settings(:project_id => 'abc')
+
+ assert_empty import.mapping
+ end
end