Sha256: c1741a59f4de3f3f9bb632a7050abf354087a127fbfbb864ddf0ec711048d0c0
Contents?: true
Size: 618 Bytes
Versions: 20
Compression:
Stored size: 618 Bytes
Contents
require 'test_helper' require 'warden' class TestController < ActionController::TestCase setup do @routes = Rails.application.routes @controller.env['warden'] = @request.env['warden'] = Warden::Proxy.new(@request.env, self.class.manager) end def log_in!(user = nil) user ||= User.first proxy.set_user user end def self.manager @manager ||= Warden::Manager.new(self, { default_strategies: :password, failure_app: SessionsController.action(:failed) }) end def teardown Warden.test_reset! end def proxy @controller.env['warden'] end end
Version data entries
20 entries across 20 versions & 1 rubygems