Class: Authlogic::TestCase::RailsRequestAdapter
- Inherits:
-
ControllerAdapters::AbstractAdapter
- Object
- ControllerAdapters::AbstractAdapter
- Authlogic::TestCase::RailsRequestAdapter
- Defined in:
- lib/authlogic/test_case/rails_request_adapter.rb
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.
Constant Summary
Constants inherited from ControllerAdapters::AbstractAdapter
ControllerAdapters::AbstractAdapter::ENV_SESSION_OPTIONS, ControllerAdapters::AbstractAdapter::E_COOKIE_DOMAIN_ADAPTER
Instance Attribute Summary
Attributes inherited from ControllerAdapters::AbstractAdapter
Instance Method Summary collapse
- #authenticate_with_http_basic(&block) ⇒ Object
- #cookie_domain ⇒ Object
- #cookies ⇒ Object
- #request ⇒ Object
- #request_content_type ⇒ Object
Methods inherited from ControllerAdapters::AbstractAdapter
#initialize, #last_request_update_allowed?, #params, #renew_session_id, #respond_to_missing?, #responds_to_single_access_allowed?, #session, #single_access_allowed?
Constructor Details
This class inherits a constructor from Authlogic::ControllerAdapters::AbstractAdapter
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
9 10 |
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 9 def authenticate_with_http_basic(&block) end |
#cookie_domain ⇒ Object
20 21 22 |
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 20 def nil end |
#cookies ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 12 def = MockCookieJar.new super.each do |key, value| [key] = (value) end end |
#request ⇒ Object
24 25 26 |
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 24 def request @request ||= MockRequest.new(controller) end |
#request_content_type ⇒ Object
28 29 30 |
# File 'lib/authlogic/test_case/rails_request_adapter.rb', line 28 def request_content_type request.format.to_s end |