summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-12-20 08:51:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-12-20 08:51:01 +0000
commit7d6fe34c52ecbda0df84e2b6ffad897f8dd4915f (patch)
tree709f180d97553d61a37bad4234549678590cb314 /test/unit
parent9db3386da4602ed3b1f991ce6caeacd1bb94a6fc (diff)
downloadredmine-7d6fe34c52ecbda0df84e2b6ffad897f8dd4915f.tar.gz
redmine-7d6fe34c52ecbda0df84e2b6ffad897f8dd4915f.zip
Merged r19381 to 4.1-stable (#21766).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19387 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-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