mirror of
https://github.com/redmine/redmine.git
synced 2026-02-03 05:09:57 +01:00
Fixes ApplicationHelper#link_to_user
* No link to a locked user page (closes #4182) * Translate Anonymous string git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3024 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -483,4 +483,24 @@ EXPECTED
|
||||
Setting.gravatar_enabled = '0'
|
||||
assert_nil avatar(User.find_by_mail('jsmith@somenet.foo'))
|
||||
end
|
||||
|
||||
def test_link_to_user
|
||||
user = User.find(2)
|
||||
t = link_to_user(user)
|
||||
assert_equal "<a href=\"/users/2\">#{ user.name }</a>", t
|
||||
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
|
||||
end
|
||||
|
||||
def test_link_to_user_should_not_link_to_anonymous
|
||||
user = User.anonymous
|
||||
assert user.anonymous?
|
||||
t = link_to_user(user)
|
||||
assert_equal ::I18n.t(:label_user_anonymous), t
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user