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
54 54
    assert_response :success
55 55
  end
56 56

  
57
  def test_show_should_display_visible_custom_fields
58
    GroupCustomField.generate!(name: 'group_custom_field', visible: true)
59
    Group.find(10).update(custom_field_values: {GroupCustomField.last.id => 'group_custom_field_value1'})
60
    get :show, :params => {:id => 10}
61
    assert_response :success
62

  
63
    assert_select 'li', :text => /group_custom_field/
64
    assert_select 'li', :text => /group_custom_field_value1/
65
  end
66

  
67
  def test_show_should_not_display_hidden_custom_fields
68
    GroupCustomField.generate!(name: 'group_custom_field', visible: false)
69
    Group.find(10).update(custom_field_values: {GroupCustomField.last.id => 'group_custom_field_value1'})
70
    get :show, :params => {:id => 10}
71
    assert_response :success
72

  
73
    assert_select 'li', :text => /group_custom_field/, :count => 0
74
    assert_select 'li', :text => /group_custom_field_value1/, :count => 0
75
  end
76

  
57 77
  def test_show_invalid_should_return_404
58 78
    get :show, :params => {
59 79
        :id => 99
(4-4/4)