Project

General

Profile

Patch #29189 » add_test_to_29189_patch.patch

Mizuki ISHIKAWA, 2018-07-06 06:45

View differences:

test/functional/groups_controller_test.rb
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
(4-4/4)