diff options
Diffstat (limited to 'test/helpers/application_helper_test.rb')
-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? |