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
This commit is contained in:
1 parent
50037b18c4
commit
7729178d9d
6 files changed
+38
-9
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user