summaryrefslogtreecommitdiff
path: root/users/test/support/auth_test_helper.rb
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-01-17 10:39:15 -0800
committerjessib <jessib@leap.se>2013-01-17 10:39:15 -0800
commit7d7741f7d26c3ae7ee1dc347a6b1a1142a3c2824 (patch)
tree5ec11b9600d4330ec94f56dda779634cd7dcae1b /users/test/support/auth_test_helper.rb
parent2485527650c4832d764d318e91c10bafde8b8ae5 (diff)
parentb550cd14f33b9664fe6b547dc56107fae7d12caf (diff)
Merge branch 'master' into feature/unauthenticated_tickets
Conflicts: help/app/views/tickets/_comment.html.haml help/app/views/tickets/_new_comment.html.haml
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