Method: Warden::Test::Helpers#login_as
- Defined in:
- lib/warden/test/helpers.rb
#login_as(user, opts = {}) ⇒ Object
A helper method that will perform a login of a user in warden for the next request. Provide it the same options as you would to Warden::Proxy#set_user
18 19 20 21 22 23 |
# File 'lib/warden/test/helpers.rb', line 18 def login_as(user, opts = {}) Warden.on_next_request do |proxy| opts[:event] ||= :authentication proxy.set_user(user, opts) end end |