mirror of
https://github.com/redmine/redmine.git
synced 2026-01-24 08:19:53 +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:
2
test/fixtures/users.yml
vendored
2
test/fixtures/users.yml
vendored
@@ -83,7 +83,7 @@ users_005:
|
||||
users_006:
|
||||
id: 6
|
||||
created_on: 2006-07-19 19:33:19 +02:00
|
||||
status: 1
|
||||
status: 0
|
||||
last_login_on:
|
||||
language: ''
|
||||
hashed_password: 1
|
||||
|
||||
@@ -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