diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 554323897d..eb9f4a4d99 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -54,6 +54,26 @@ class GroupsControllerTest < Redmine::ControllerTest assert_response :success end + def test_show_should_display_visible_custom_fields + GroupCustomField.generate!(name: 'group_custom_field', visible: true) + Group.find(10).update(custom_field_values: {GroupCustomField.last.id => 'group_custom_field_value1'}) + get :show, :params => {:id => 10} + assert_response :success + + assert_select 'li', :text => /group_custom_field/ + assert_select 'li', :text => /group_custom_field_value1/ + end + + def test_show_should_not_display_hidden_custom_fields + GroupCustomField.generate!(name: 'group_custom_field', visible: false) + Group.find(10).update(custom_field_values: {GroupCustomField.last.id => 'group_custom_field_value1'}) + get :show, :params => {:id => 10} + assert_response :success + + assert_select 'li', :text => /group_custom_field/, :count => 0 + assert_select 'li', :text => /group_custom_field_value1/, :count => 0 + end + def test_show_invalid_should_return_404 get :show, :params => { :id => 99