diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-11 10:48:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-11 10:48:54 +0000 |
commit | c31411ec0029d5b2033d2d91aef18f601a8a7224 (patch) | |
tree | dbbf2414f6d85a7bb05aad58297398fd0e692c99 /test | |
parent | 8f40750ad7f7ad512fd816757f072c42fae20e66 (diff) | |
download | redmine-c31411ec0029d5b2033d2d91aef18f601a8a7224.tar.gz redmine-c31411ec0029d5b2033d2d91aef18f601a8a7224.zip |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/users.yml | 2 | ||||
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 29d4f1565..29fc6be04 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -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 diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 84fc3bd6b..05742150b 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -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 |