Class: Authlogic::TestCase::RailsRequestAdapter
Overview
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.
Instance Attribute Summary
#controller
Instance Method Summary
collapse
#initialize, #last_request_update_allowed?, #params, #responds_to_last_request_update_allowed?, #responds_to_single_access_allowed?, #session, #single_access_allowed?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Authlogic::ControllerAdapters::AbstractAdapter
Instance Method Details
#authenticate_with_http_basic(&block) ⇒ Object
6
7
|
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 6
def authenticate_with_http_basic(&block)
end
|
#cookie_domain ⇒ Object
17
18
19
|
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 17
def cookie_domain
nil
end
|
#cookies ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 9
def cookies
new_cookies = MockCookieJar.new
super.each do |key, value|
new_cookies[key] = value[:value]
end
new_cookies
end
|
#request ⇒ Object
21
22
23
|
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 21
def request
@request ||= MockRequest.new(controller)
end
|
#request_content_type ⇒ Object
25
26
27
|
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 25
def request_content_type
request.format.to_s
end
|