diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-18 17:08:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-18 17:08:42 +0000 |
commit | 7729178d9d50c6854e4602f4955f9e7f0598001c (patch) | |
tree | ef407662e58d5a99e9cf5d345269922dd0e2c550 /test/test_helper.rb | |
parent | 50037b18c49267229048c9b8126708a30626bde7 (diff) | |
download | redmine-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/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index 66a6f2646..3c2cece7b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -114,6 +114,15 @@ class ActiveSupport::TestCase saved_settings.each {|k, v| Setting[k] = v} if saved_settings end + # Yields the block with user as the current user + def with_current_user(user, &block) + saved_user = User.current + User.current = user + yield + ensure + User.current = saved_user + end + def change_user_password(login, new_password) user = User.first(:conditions => {:login => login}) user.password, user.password_confirmation = new_password, new_password |