Module | Devise::TestHelpers |
In: |
lib/devise/test_helpers.rb
|
Devise::TestHelpers provides a facility to test controllers in isolation when using ActionController::TestCase allowing you to quickly sign_in or sign_out a user. Do not use Devise::TestHelpers in integration tests.
Notice you should not test Warden specific behavior (like Warden callbacks) using Devise::TestHelpers since it is a stub of the actual behavior. Such callbacks should be tested in your integration suite instead.
sign_in a given resource by storing its keys in the session. This method bypass any warden authentication callback.
Examples:
sign_in :user, @user # sign_in(scope, resource) sign_in @user # sign_in(resource)
Sign out a given resource or scope by calling logout on Warden. This method bypass any warden logout callback.
Examples:
sign_out :user # sign_out(scope) sign_out @user # sign_out(resource)