1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-01 03:57:15 +00:00

Adds a test for importing list custom fields (#26148).

git-svn-id: http://svn.redmine.org/redmine/trunk@16834 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-07-19 14:58:06 +00:00
parent 5bb28ab8f6
commit 3cc483180a

View File

@ -147,6 +147,20 @@ class IssueImportTest < ActiveSupport::TestCase
assert_equal '3', issues.first.custom_field_value(field)
end
def test_list_custom_field_should_be_set
field = CustomField.find(1)
field.tracker_ids = Tracker.all.ids
field.save!
import = generate_import_with_mapping
import.mapping.merge!("cf_1" => '8')
import.save!
issues = new_records(Issue, 3) { import.run }
assert_equal 'PostgreSQL', issues[0].custom_field_value(1)
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')