summaryrefslogtreecommitdiff
path: root/users/test/support/auth_test_helper.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-14 20:11:49 +0100
committerAzul <azul@leap.se>2013-01-14 20:11:49 +0100
commit8445e6b1a026c8f15fffae7544b84407e9bbce1b (patch)
tree859adf3bac117389595460916f45cfeab49f58cb /users/test/support/auth_test_helper.rb
parentf75005e1bc15101f37d377b7ed06f877dc206ee0 (diff)
parentee2ea4ac8f4c6b0c3b09be6ed49e7a1faec7a9c1 (diff)
Merge branch 'master' into feature/fixing-routes-with-api
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