summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_import_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-19 17:07:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-19 17:07:13 +0000
commit1ff3e910333113c7e36c276cada886a757337f49 (patch)
tree8a342dc606d0701667a16e23c74770b738e05a39 /test/unit/issue_import_test.rb
parentfee7339c149058897ce028826907c2bdf73d0b38 (diff)
downloadredmine-1ff3e910333113c7e36c276cada886a757337f49.tar.gz
redmine-1ff3e910333113c7e36c276cada886a757337f49.zip
Adds a test for importing list custom fields with multiple values (#26148).
git-svn-id: http://svn.redmine.org/redmine/trunk@16837 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r--test/unit/issue_import_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb
index 41958cb6a..bcbf942ae 100644
--- a/test/unit/issue_import_test.rb
+++ b/test/unit/issue_import_test.rb
@@ -161,6 +161,21 @@ class IssueImportTest < ActiveSupport::TestCase
assert_equal '', issues.third.custom_field_value(1)
end
+ def test_multiple_list_custom_field_should_be_set
+ field = CustomField.find(1)
+ field.tracker_ids = Tracker.all.ids
+ field.multiple = true
+ field.save!
+ import = generate_import_with_mapping
+ import.mapping.merge!("cf_1" => '15')
+ import.save!
+
+ issues = new_records(Issue, 3) { import.run }
+ assert_equal ['Oracle', 'PostgreSQL'], issues[0].custom_field_value(1).sort
+ assert_equal ['MySQL'], issues[1].custom_field_value(1)
+ assert_equal [''], issues.third.custom_field_value(1)
+ end
+
def test_is_private_should_be_set_based_on_user_locale
import = generate_import_with_mapping
import.mapping.merge!('is_private' => '6')