Display user's groups on profile (#12796).

Only for admins or when viewing its own profile.

git-svn-id: http://svn.redmine.org/redmine/trunk@17973 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2019-03-15 11:49:51 +00:00
parent e26ab0d4a2
commit ccda34cac6
4 changed files with 54 additions and 0 deletions

View File

@@ -112,6 +112,9 @@ class UsersControllerTest < Redmine::ControllerTest
get :show, :params => {:id => 2}
assert_response :success
assert_select 'h2', :text => /John Smith/
# groups block should not be rendeder for users which are not part of any group
assert_select 'div#groups', 0
end
def test_show_should_display_visible_custom_fields
@@ -206,6 +209,18 @@ class UsersControllerTest < Redmine::ControllerTest
end
end
def test_show_user_should_list_user_groups
@request.session[:user_id] = 1
get :show, :params => {:id => 8}
assert_select 'div#groups', 1 do
assert_select 'h3', :text => 'Groups'
assert_select 'li', 2
assert_select 'a[href=?]', '/groups/10/edit', :text => 'A Team'
assert_select 'a[href=?]', '/groups/11/edit', :text => 'B Team'
end
end
def test_new
get :new
assert_response :success