Sha256: d062e9c9d9ff12cc2c1f4effbf2e60c9346593ac4a4439595e1d91fd55189c02

Contents?: true

Size: 782 Bytes

Versions: 70

Compression:

Stored size: 782 Bytes

Contents

module Authlogic
  module TestCase
    # Adapts authlogic to work with the @request object when testing. This way Authlogic can set cookies and what not before
    # a request is made, ultimately letting you log in users in functional tests.
    class RailsRequestAdapter < ControllerAdapters::AbstractAdapter
      def authenticate_with_http_basic(&block)
      end
      
      def cookies
        new_cookies = MockCookieJar.new
        super.each do |key, value|
          new_cookies[key] = value[:value]
        end
        new_cookies
      end
      
      def cookie_domain
        nil
      end
      
      def request
        @request ||= MockRequest.new(controller)
      end
      
      def request_content_type
        request.format.to_s
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 22 rubygems

Version Path
authlogic-3.1.2 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-3.1.1 lib/authlogic/test_case/rails_request_adapter.rb
nulogy-authlogic-3.1.0.1 lib/authlogic/test_case/rails_request_adapter.rb
Empact-authlogic-3.1.0 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-3.1.0 lib/authlogic/test_case/rails_request_adapter.rb
Empact-authlogic-3.0.3 lib/authlogic/test_case/rails_request_adapter.rb
expertiza-authlogic-2.1.6.1 lib/authlogic/test_case/rails_request_adapter.rb
antlypls-authlogic-3.0.3 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-3.0.3 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-3.0.2 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-3.0.1 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-3.0.0 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-rails3-2.2 lib/authlogic/test_case/rails_request_adapter.rb
kb-authlogic-2.1.7 lib/authlogic/test_case/rails_request_adapter.rb
wulffeld_authlogic-2.1.3 lib/authlogic/test_case/rails_request_adapter.rb
railsware-authlogic-2.1.6.1 lib/authlogic/test_case/rails_request_adapter.rb
cotweet-authlogic-2.1.6 lib/authlogic/test_case/rails_request_adapter.rb
jdl-authlogic-2.1.6.2 lib/authlogic/test_case/rails_request_adapter.rb
jdl-authlogic-2.1.6.1 lib/authlogic/test_case/rails_request_adapter.rb
authlogic-2.1.6 lib/authlogic/test_case/rails_request_adapter.rb