]> source.dussan.org Git - redmine.git/commitdiff
Merged r14160 (#19580).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 25 Apr 2015 07:46:28 +0000 (07:46 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 25 Apr 2015 07:46:28 +0000 (07:46 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@14212 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/workflows/permissions.html.erb
test/functional/workflows_controller_test.rb

index 54b8304ce9038b90c4603c4c49e8c1d07eaec378..9a9c024d3580ef8eb3adbda9473ea25974e1d3fa 100644 (file)
@@ -65,7 +65,7 @@
           <%=h 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">&#187;</a><% end %>
         </td>
index 2ce967bb001ba9b5a93e059942c8032b188e6436..5f11d699bcc8a1ba126ee447f5cc9c2e9d6c2834 100644 (file)
@@ -251,6 +251,15 @@ class WorkflowsControllerTest < ActionController::TestCase
     assert_equal IssueStatus.sorted.all, 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