Class: Authlogic::TestCase::MockController
Overview
Basically acts like a 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
ControllerAdapters::AbstractAdapter::ENV_SESSION_OPTIONS, ControllerAdapters::AbstractAdapter::E_COOKIE_DOMAIN_ADAPTER
Instance Attribute Summary collapse
#controller
Instance Method Summary
collapse
#last_request_update_allowed?, #renew_session_id, #respond_to_missing?, #responds_to_single_access_allowed?, #single_access_allowed?
Constructor Details
Returns a new instance of MockController.
12
13
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 12
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
#http_password ⇒ Object
Returns the value of attribute http_password.
9
10
11
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 9
def http_password
@http_password
end
|
#http_user ⇒ Object
Returns the value of attribute http_user.
9
10
11
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 9
def http_user
@http_user
end
|
#realm ⇒ Object
Returns the value of attribute realm.
9
10
11
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 9
def realm
@realm
end
|
#request_content_type ⇒ Object
45
46
47
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 45
def request_content_type
@request_content_type ||= "text/html"
end
|
Instance Method Details
#authenticate_or_request_with_http_basic(realm = "DefaultRealm") {|http_user, http_password| ... } ⇒ Object
19
20
21
22
23
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 19
def authenticate_or_request_with_http_basic(realm = "DefaultRealm")
self.realm = realm
@http_auth_requested = true
yield http_user, http_password
end
|
#authenticate_with_http_basic {|http_user, http_password| ... } ⇒ Object
15
16
17
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 15
def authenticate_with_http_basic
yield http_user, http_password
end
|
#cookie_domain ⇒ Object
29
30
31
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 29
def cookie_domain
nil
end
|
#cookies ⇒ Object
25
26
27
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 25
def cookies
@cookies ||= MockCookieJar.new
end
|
#http_auth_requested? ⇒ Boolean
53
54
55
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 53
def http_auth_requested?
@http_auth_requested ||= false
end
|
#logger ⇒ Object
33
34
35
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 33
def logger
@logger ||= MockLogger.new
end
|
#params ⇒ Object
37
38
39
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 37
def params
@params ||= {}
end
|
#request ⇒ Object
41
42
43
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 41
def request
@request ||= MockRequest.new(self)
end
|
#session ⇒ Object
49
50
51
|
# File 'lib/authlogic/test_case/mock_controller.rb', line 49
def session
@session ||= {}
end
|