summaryrefslogtreecommitdiff
path: root/users/test/support/auth_test_helper.rb
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-12-07 10:31:12 -0800
committerjessib <jessib@leap.se>2012-12-07 10:31:12 -0800
commite1a004e2b24c2c235452469abfefa033e24435b2 (patch)
treea4b1c89a5aa4d5ccb3c17521499c999dedd5842d /users/test/support/auth_test_helper.rb
parent4793c2b770fcb018303b7ab226b75cc218364327 (diff)
parent8282b83c798ba4e5c1e26ec8243b82669b3ee6d4 (diff)
Merge branch 'master' into help_develop
Conflicts: app/views/layouts/application.html.haml help/app/controllers/tickets_controller.rb help/test/functional/tickets_controller_test.rb users/test/support/stub_record_helper.rb
Diffstat (limited to 'users/test/support/auth_test_helper.rb')
-rw-r--r--users/test/support/auth_test_helper.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/users/test/support/auth_test_helper.rb b/users/test/support/auth_test_helper.rb
index 99dc141..6a82f24 100644
--- a/users/test/support/auth_test_helper.rb
+++ b/users/test/support/auth_test_helper.rb
@@ -10,8 +10,8 @@ module AuthTestHelper
end
end
- def login(user_or_method_hash = nil)
- @current_user = stub_user(user_or_method_hash)
+ 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)
end
@@ -30,19 +30,6 @@ module AuthTestHelper
end
end
- protected
-
- # Will create a stub user for logging in from either
- # * a hash of methods to stub
- # * a user record
- # * nil -> create a user record stub
- def stub_user(user_or_method_hash)
- if user_or_method_hash.is_a?(Hash)
- stub_record User, user_or_method_hash
- else
- user_or_method_hash || stub_record(User)
- end
- end
end
class ActionController::TestCase