Project

General

Profile

Defect #22305 » defect-22305.diff

Go MAEDA, 2016-03-27 06:32

View differences:

app/views/workflows/permissions.html.erb (working copy)
85 85
            <%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
86 86
          </td>
87 87
          <% for status in @statuses -%>
88
          <td class="<%= @permissions[status.id][field.id.to_s] %>">
88
          <td class="<%= @permissions[status.id][field.id.to_s].try(:join, ' ') %>">
89 89
            <%= field_permission_tag(@permissions, status, field, @roles) %>
90 90
            <% unless status == @statuses.last %><a href="#" class="repeat-value">&#187;</a><% end %>
91 91
          </td>
test/functional/workflows_controller_test.rb (working copy)
284 284
  def test_get_permissions_should_set_css_class
285 285
    WorkflowPermission.delete_all
286 286
    WorkflowPermission.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :field_name => 'assigned_to_id', :rule => 'required')
287
    cf = IssueCustomField.create!(:name => 'Foo', :field_format => 'string', :tracker_ids => [2])
288
    WorkflowPermission.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :field_name => cf.id, :rule => 'required')
287 289

  
288 290
    get :permissions, :role_id => 1, :tracker_id => 2
289 291
    assert_response :success
290 292
    assert_select 'td.required > select[name=?]', 'permissions[1][assigned_to_id]'
293
    assert_select 'td.required > select[name=?]', "permissions[1][#{cf.id}]"
291 294
  end
292 295

  
293 296
  def test_post_permissions
(2-2/2)