Browse Source

Test for r17441 (#29189).

Contributed by Mizuki ISHIKAWA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17442 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.0.0
Go MAEDA 5 years ago
parent
commit
3a894f3a91
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      test/functional/groups_controller_test.rb

+ 14
- 0
test/functional/groups_controller_test.rb View File

@@ -54,6 +54,20 @@ class GroupsControllerTest < Redmine::ControllerTest
assert_response :success
end

def test_show_should_display_custom_fields
GroupCustomField.generate!(name: 'field_visible', visible: true)
Group.find(10).update(custom_field_values: {GroupCustomField.last.id => 'value_visible'})
GroupCustomField.generate!(name: 'field_invisible', visible: false)
Group.find(10).update(custom_field_values: {GroupCustomField.last.id => 'value_invisible'})
get :show, :params => {:id => 10}
assert_response :success

assert_select 'li', :text => /field_visible/
assert_select 'li', :text => /value_visible/
assert_select 'li', :text => /field_invisible/, :count => 0
assert_select 'li', :text => /value_invisible/, :count => 0
end

def test_show_invalid_should_return_404
get :show, :params => {
:id => 99

Loading…
Cancel
Save