Class: Authlogic::TestCase::MockAPIController

Inherits:
ControllerAdapters::AbstractAdapter show all
Defined in:
lib/authlogic/test_case/mock_api_controller.rb

Overview

Basically acts like an API 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.

Constant Summary

Constants inherited from ControllerAdapters::AbstractAdapter

ControllerAdapters::AbstractAdapter::ENV_SESSION_OPTIONS, ControllerAdapters::AbstractAdapter::E_COOKIE_DOMAIN_ADAPTER

Instance Attribute Summary collapse

Attributes inherited from ControllerAdapters::AbstractAdapter

#controller

Instance Method Summary collapse

Methods inherited from ControllerAdapters::AbstractAdapter

#authenticate_with_http_basic, #cookies, #last_request_update_allowed?, #renew_session_id, #respond_to_missing?, #responds_to_single_access_allowed?, #single_access_allowed?

Constructor Details

#initializeMockAPIController

Returns a new instance of MockAPIController.



11
12
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 11

def initialize
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Authlogic::ControllerAdapters::AbstractAdapter

Instance Attribute Details

#request_content_typeObject



33
34
35
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 33

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

Instance Method Details



17
18
19
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 17

def cookie_domain
  nil
end

#loggerObject



21
22
23
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 21

def logger
  @logger ||= MockLogger.new
end

#paramsObject



25
26
27
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 25

def params
  @params ||= {}
end

#requestObject



29
30
31
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 29

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

#sessionObject



37
38
39
# File 'lib/authlogic/test_case/mock_api_controller.rb', line 37

def session
  @session ||= {}
end