From ccda34cac6267fa95bb17cf458078565ff5f8822 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 15 Mar 2019 11:49:51 +0000 Subject: 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 --- test/helpers/application_helper_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/helpers') diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 2fcbaf7f0..7b84cdad6 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -1536,6 +1536,19 @@ RAW end end + def test_link_to_group_should_return_only_group_name_for_non_admin_users + User.current = nil + group = Group.find(10) + assert_equal "A Team", link_to_group(group) + end + + def test_link_to_group_should_link_to_group_edit_page_for_admin_users + User.current = User.find(1) + group = Group.find(10) + result = link_to("A Team", "/groups/10/edit") + assert_equal result, link_to_group(group) + end + def test_link_to_user_should_not_link_to_anonymous user = User.anonymous assert user.anonymous? -- cgit v1.2.3