Class: Authentication::Logic::TestCase::RailsRequestAdapter
- Inherits:
-
ControllerAdapters::AbstractAdapter
- Object
- ControllerAdapters::AbstractAdapter
- Authentication::Logic::TestCase::RailsRequestAdapter
- Defined in:
- lib/auth/logic/test_case/rails_request_adapter.rb
Overview
Adapts authlogic to work with the @request object when testing. This way Authentication::Logic 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 Authentication::Logic::ControllerAdapters::AbstractAdapter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Authentication::Logic::ControllerAdapters::AbstractAdapter
Instance Method Details
#authenticate_with_http_basic(&block) ⇒ Object
10 |
# File 'lib/auth/logic/test_case/rails_request_adapter.rb', line 10 def authenticate_with_http_basic(&block); end |
#cookie_domain ⇒ Object
20 21 22 |
# File 'lib/auth/logic/test_case/rails_request_adapter.rb', line 20 def nil end |
#cookies ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/auth/logic/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/auth/logic/test_case/rails_request_adapter.rb', line 24 def request @request ||= MockRequest.new(controller) end |
#request_content_type ⇒ Object
28 29 30 |
# File 'lib/auth/logic/test_case/rails_request_adapter.rb', line 28 def request_content_type request.format.to_s end |