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

Version Path
ecrire-0.31.2 test/test_controller.rb
ecrire-0.31.1 test/test_controller.rb
ecrire-0.31.0 test/test_controller.rb
ecrire-0.30.3 test/test_controller.rb
ecrire-0.30.2 test/test_controller.rb
ecrire-0.30.1 test/test_controller.rb
ecrire-0.30.0 test/test_controller.rb
ecrire-0.29.0 test/test_controller.rb
ecrire-0.28.3 test/test_controller.rb
ecrire-0.28.2 test/test_controller.rb
ecrire-0.28.1 test/test_controller.rb
ecrire-0.28.0 test/test_controller.rb
ecrire-0.27.0 test/test_controller.rb
ecrire-0.26.3 test/test_controller.rb
ecrire-0.26.2 test/test_controller.rb
ecrire-0.26.1 test/test_controller.rb
ecrire-0.26.0 test/test_controller.rb
ecrire-0.25.2 test/test_controller.rb
ecrire-0.25.1 test/test_controller.rb
ecrire-0.25.0 test/test_controller.rb