summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-18 17:08:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-18 17:08:42 +0000
commit7729178d9d50c6854e4602f4955f9e7f0598001c (patch)
treeef407662e58d5a99e9cf5d345269922dd0e2c550 /test/unit
parent50037b18c49267229048c9b8126708a30626bde7 (diff)
downloadredmine-7729178d9d50c6854e4602f4955f9e7f0598001c.tar.gz
redmine-7729178d9d50c6854e4602f4955f9e7f0598001c.zip
Adds links to locked users when current user is admin.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10673 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/helpers/application_helper_test.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 9855efa27..4bf191f01 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -1010,15 +1010,23 @@ RAW
def test_link_to_user
user = User.find(2)
- t = link_to_user(user)
- assert_equal "<a href=\"/users/2\">#{ user.name }</a>", t
+ assert_equal '<a href="/users/2" class="user active">John Smith</a>', link_to_user(user)
end
def test_link_to_user_should_not_link_to_locked_user
- user = User.find(5)
- assert user.locked?
- t = link_to_user(user)
- assert_equal user.name, t
+ with_current_user nil do
+ user = User.find(5)
+ assert user.locked?
+ assert_equal 'Dave2 Lopper2', link_to_user(user)
+ end
+ end
+
+ def test_link_to_user_should_link_to_locked_user_if_current_user_is_admin
+ with_current_user User.find(1) do
+ user = User.find(5)
+ assert user.locked?
+ assert_equal '<a href="/users/5" class="user locked">Dave2 Lopper2</a>', link_to_user(user)
+ end
end
def test_link_to_user_should_not_link_to_anonymous