]> source.dussan.org Git - redmine.git/commitdiff
GroupsController#show should only display visible users (#12795).
authorGo MAEDA <maeda@farend.jp>
Sat, 31 Jul 2021 00:53:08 +0000 (00:53 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 31 Jul 2021 00:53:08 +0000 (00:53 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@21113 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/groups/show.html.erb
test/functional/groups_controller_test.rb

index ad7ee2626ae975b4f08f63142906a2318635d2db..001bfe8ad8546bd7ea4a9a705d27b9a9424987e2 100644 (file)
@@ -14,7 +14,7 @@
 
 <h3><%= l(:label_member_plural) %></h3>
 <ul>
-<% @group.users.each do |user| %>
+<% @group.users.visible.each do |user| %>
     <li><%= user %></li>
 <% end %>
 </ul>
index efb5881988784e561a9652b24846217f2ed4e9af..c62aa5a7d9e205d76fdf45df9315a7af1af8e52d 100644 (file)
@@ -81,6 +81,20 @@ class GroupsControllerTest < Redmine::ControllerTest
     assert_response 404
   end
 
+  def test_show_should_display_only_visible_users
+    group = Group.find(10)
+    locked_user = User.find(5)
+    group.users << locked_user
+    assert locked_user.locked?
+
+    @request.session[:user_id] = nil
+    get :show, :params => {:id => group.id}
+    assert_response :success
+
+    assert_select 'li', :text => 'User Misc'
+    assert_select 'li', :text => locked_user.name, :count => 0
+  end
+
   def test_new
     get :new
     assert_response :success