]> source.dussan.org Git - redmine.git/commitdiff
Test for r19588 (#33085).
authorGo MAEDA <maeda@farend.jp>
Fri, 20 Mar 2020 02:31:13 +0000 (02:31 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 20 Mar 2020 02:31:13 +0000 (02:31 +0000)
Patch by Mizuki ISHIKAWA.

git-svn-id: http://svn.redmine.org/redmine/trunk@19589 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/enumerations_controller_test.rb

index 05e6311067edfe5d2f1fd5b4655b5b40ab7775c1..438ef9f7bb45052bf1a9e7abf0b6f1f6b0ae7502 100644 (file)
@@ -84,6 +84,21 @@ class EnumerationsControllerTest < Redmine::ControllerTest
     assert_equal "sample", Enumeration.find_by(:name => 'Sample').custom_field_values.last.value
   end
 
+  def test_create_with_multiple_select_list_custom_fields
+    custom_field = IssuePriorityCustomField.generate!(:field_format => 'list', :multiple => true, :possible_values => ['1', '2', '3', '4'])
+    assert_difference 'IssuePriority.count' do
+      post :create, :params => {
+          :enumeration => {
+            :type => 'IssuePriority',
+            :name => 'Sample',
+            :custom_field_values => {custom_field.id.to_s => ['1', '2']}
+          }
+        }
+    end
+    assert_redirected_to '/enumerations'
+    assert_equal ['1', '2'].sort, Enumeration.find_by(:name => 'Sample').custom_field_values.last.value.sort
+  end
+
   def test_create_with_failure
     assert_no_difference 'IssuePriority.count' do
       post :create, :params => {