summaryrefslogtreecommitdiff
path: root/users/test/support/auth_test_helper.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-14 16:24:25 +0100
committerAzul <azul@leap.se>2013-01-14 16:24:25 +0100
commita9ef046a596b5876792b1cc4ab0d26b9b255c342 (patch)
treefe691c72f36b42f74a1d850f2e406c50500036e3 /users/test/support/auth_test_helper.rb
parent3cd3c261bdf02b2da5217fa1c469d30f9d92c9a3 (diff)
tickets controller tests passing
Diffstat (limited to 'users/test/support/auth_test_helper.rb')
-rw-r--r--users/test/support/auth_test_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/users/test/support/auth_test_helper.rb b/users/test/support/auth_test_helper.rb
index c9f5612..c0fcf3a 100644
--- a/users/test/support/auth_test_helper.rb
+++ b/users/test/support/auth_test_helper.rb
@@ -10,10 +10,10 @@ module AuthTestHelper
end
def login(user_or_method_hash = {})
- @current_user = stub_record(User, user_or_method_hash)
- unless @current_user.respond_to? :is_admin?
- @current_user.stubs(:is_admin?).returns(false)
+ if user_or_method_hash.respond_to?(:reverse_merge)
+ user_or_method_hash.reverse_merge! :is_admin? => false
end
+ @current_user = stub_record(:user, user_or_method_hash, true)
request.env['warden'] = stub :user => @current_user
return @current_user
end