diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-03-15 11:49:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-03-15 11:49:51 +0000 |
commit | ccda34cac6267fa95bb17cf458078565ff5f8822 (patch) | |
tree | b3611e539e72bfa44bc1ee0f14a68fb834fcd3c5 /test/helpers | |
parent | e26ab0d4a251cc8fcd476a6140bccfcd24a9c446 (diff) | |
download | redmine-ccda34cac6267fa95bb17cf458078565ff5f8822.tar.gz redmine-ccda34cac6267fa95bb17cf458078565ff5f8822.zip |
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
Diffstat (limited to 'test/helpers')
-rw-r--r-- | test/helpers/application_helper_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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? |