Sha256: 2081984499ff68349fc6dbfc0fea53e230bd5d878705b28819170833cd61d94c

Contents?: true

Size: 973 Bytes

Versions: 14

Compression:

Stored size: 973 Bytes

Contents

module Authlogic
  module TestCase
    # Basically acts like a controller but doesn't do anything. Authlogic can interact with this, do it's thing and then you
    # can look at the controller object to see if anything changed.
    class MockController < ControllerAdapters::AbstractAdapter
      attr_accessor :http_user, :http_password
      attr_writer :request_content_type

      def initialize
      end

      def authenticate_with_http_basic(&block)
        yield http_user, http_password
      end

      def cookies
        @cookies ||= MockCookieJar.new
      end

      def cookie_domain
        nil
      end

      def logger
        @logger ||= MockLogger.new
      end

      def params
        @params ||= {}
      end

      def request
        @request ||= MockRequest.new(controller)
      end

      def request_content_type
        @request_content_type ||= "text/html"
      end

      def session
        @session ||= {}
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
refinerycms-0.9.6.34 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.33 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.32 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.31 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.30 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.29 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.28 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.27 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.26 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.25 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.24 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.23 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.22 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb
refinerycms-0.9.6.21 vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb