diff options
-rw-r--r-- | app/views/workflows/permissions.html.erb | 2 | ||||
-rw-r--r-- | test/functional/workflows_controller_test.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/views/workflows/permissions.html.erb b/app/views/workflows/permissions.html.erb index 7b4b3f840..03740214d 100644 --- a/app/views/workflows/permissions.html.erb +++ b/app/views/workflows/permissions.html.erb @@ -65,7 +65,7 @@ <%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %> </td> <% for status in @statuses -%> - <td class="<%= @permissions[status.id][field] %>"> + <td class="<%= @permissions[status.id][field].try(:join, ' ') %>"> <%= field_permission_tag(@permissions, status, field, @roles) %> <% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %> </td> diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb index 85e0a1cf5..d59614aea 100644 --- a/test/functional/workflows_controller_test.rb +++ b/test/functional/workflows_controller_test.rb @@ -257,6 +257,15 @@ class WorkflowsControllerTest < ActionController::TestCase assert_equal IssueStatus.sorted.to_a, assigns(:statuses) end + def test_get_permissions_should_set_css_class + WorkflowPermission.delete_all + WorkflowPermission.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :field_name => 'assigned_to_id', :rule => 'required') + + get :permissions, :role_id => 1, :tracker_id => 2 + assert_response :success + assert_select 'td.required > select[name=?]', 'permissions[1][assigned_to_id]' + end + def test_post_permissions WorkflowPermission.delete_all |