Module: Authenticate::Testing::ViewHelpers
- Defined in:
- lib/authenticate/testing/view_helpers.rb
Overview
Helpers for view tests/specs.
Use login_as to log in a user for your test case, which allows ‘current_user`, `logged_in?` and `logged_out?` to work properly in your test.
Defined Under Namespace
Modules: CurrentUser
Instance Method Summary collapse
-
#login_as(user) ⇒ Object
Set the current_user on the view being tested.
Instance Method Details
#login_as(user) ⇒ Object
Set the current_user on the view being tested.
11 12 13 |
# File 'lib/authenticate/testing/view_helpers.rb', line 11 def login_as(user) view.current_user = user end |