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

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

index 2c529864e25a79ac43f63d26a0ac6b16e6a413f7..bd2711504c849f9543dc8469e6282b052741062e 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 85e0a1cf5eb3ed7beeb16faaaff75e37270ebc16..d59614aea4681392ed069cafb1c1be0ec491b4e1 100644 (file)
@@ -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