summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-10 13:03:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-10 13:03:52 +0000
commita18c719fcc9cf2bf44bed59944ae1ad349dce970 (patch)
tree3e9f836b1c3edda9f6decb095509e58e1e02c01f /test/functional
parenta77d884157439c226342e789f13bd6bfe8dd4227 (diff)
downloadredmine-a18c719fcc9cf2bf44bed59944ae1ad349dce970.tar.gz
redmine-a18c719fcc9cf2bf44bed59944ae1ad349dce970.zip
Fixed: Custom field is rendered, even if its value is empty (for multiple) (#18654).
git-svn-id: http://svn.redmine.org/redmine/trunk@13864 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/projects_controller_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 8e209002d..7ca53d9bd 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -351,6 +351,18 @@ class ProjectsControllerTest < ActionController::TestCase
assert_select 'li', :text => /Development status/, :count => 0
end
+ def test_show_should_not_display_blank_custom_fields_with_multiple_values
+ f1 = ProjectCustomField.generate! :field_format => 'list', :possible_values => %w(Foo Bar), :multiple => true
+ f2 = ProjectCustomField.generate! :field_format => 'list', :possible_values => %w(Baz Qux), :multiple => true
+ project = Project.generate!(:custom_field_values => {f2.id.to_s => %w(Qux)})
+
+ get :show, :id => project.id
+ assert_response :success
+
+ assert_select 'li', :text => /#{f1.name}/, :count => 0
+ assert_select 'li', :text => /#{f2.name}/
+ end
+
def test_show_should_not_fail_when_custom_values_are_nil
project = Project.find_by_identifier('ecookbook')
project.custom_values.first.update_attribute(:value, nil)