summaryrefslogtreecommitdiffstats
path: root/test/system
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-12-06 02:55:10 +0000
committerGo MAEDA <maeda@farend.jp>2020-12-06 02:55:10 +0000
commitbb5acf4ec6ab4aeb98310ea71be1e913fb4cd786 (patch)
tree3f8cca89b94d6fb888d27dfb38518df618d12d41 /test/system
parent7b926116e20842568e0f1a6c3e67bb2f742cf6fa (diff)
downloadredmine-bb5acf4ec6ab4aeb98310ea71be1e913fb4cd786.tar.gz
redmine-bb5acf4ec6ab4aeb98310ea71be1e913fb4cd786.zip
500 error when attempting to create custom field enumeration with empty name (#33930).
Patch by Kevin Fischer. git-svn-id: http://svn.redmine.org/redmine/trunk@20583 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/system')
-rw-r--r--test/system/custom_field_enumerations_test.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/system/custom_field_enumerations_test.rb b/test/system/custom_field_enumerations_test.rb
new file mode 100644
index 000000000..2ef64b0b3
--- /dev/null
+++ b/test/system/custom_field_enumerations_test.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+# Redmine - project management software
+# Copyright (C) 2006-2020 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require File.expand_path('../../application_system_test_case', __FILE__)
+
+class CustomFieldEnumerationsTest < ApplicationSystemTestCase
+ fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
+ :trackers, :projects_trackers, :enabled_modules, :issue_statuses, :issues,
+ :enumerations, :custom_fields, :custom_values, :custom_fields_trackers,
+ :watchers, :journals, :journal_details
+
+ def test_add_empty_value
+ custom_field = IssueCustomField.generate!(field_format: 'enumeration')
+ log_user('admin', 'admin')
+ visit "custom_fields/#{custom_field.id}/enumerations"
+
+ click_on 'Add'
+ assert page.has_css?('#errorExplanation', text: 'Name cannot be blank')
+ end
+end