Class: ActionView::TestCase::TestController
- Inherits:
-
ActionController::Base
- Object
- AbstractController::Base
- ActionController::Metal
- ActionController::Base
- ActionView::TestCase::TestController
- Includes:
- ActionDispatch::TestProcess
- Defined in:
- actionview/lib/action_view/test_case.rb
Constant Summary
Constants inherited from ActionController::Base
ActionController::Base::MODULES, ActionController::Base::PROTECTED_IVARS
Class Attribute Summary collapse
-
.controller_path ⇒ Object
Overrides AbstractController::Base#controller_path.
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
- #controller_path=(path) ⇒ Object
-
#initialize ⇒ TestController
constructor
A new instance of TestController.
Methods included from ActionDispatch::TestProcess
#assigns, #cookies, #flash, #redirect_to_url, #session
Methods included from ActionDispatch::TestProcess::FixtureFile
Methods inherited from ActionController::Base
Methods inherited from ActionController::Metal
action, action_encoding_template, #controller_name, dispatch, #dispatch, #headers, make_response!, middleware, #performed?, #reset_session, #response_body=, #session, #set_request!, #set_response!, #to_a, #url_for, use
Methods included from ActionController::Testing::Functional
#clear_instance_variables_between_requests, #recycle!
Methods inherited from AbstractController::Base
abstract!, action_methods, #action_methods, #action_name, #available_action?, clear_action_methods!, #controller_path, eager_load!, #formats, inherited, #inspect, internal_methods, method_added, #performed?, #process, #response_body, supports_path?
Methods included from ActiveSupport::DescendantsTracker
clear, #descendants, descendants, disable_clear!, reject!, store_inherited, subclasses, #subclasses
Methods included from ActiveSupport::Configurable
Methods included from ActiveSupport::Concern
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Constructor Details
#initialize ⇒ TestController
Returns a new instance of TestController.
34 35 36 37 38 39 40 41 42 |
# File 'actionview/lib/action_view/test_case.rb', line 34 def initialize super self.class.controller_path = "" @request = ActionController::TestRequest.create(self.class) @response = ActionDispatch::TestResponse.new @request.env.delete("PATH_INFO") @params = ActionController::Parameters.new end |
Class Attribute Details
.controller_path ⇒ Object
Overrides AbstractController::Base#controller_path
23 24 25 |
# File 'actionview/lib/action_view/test_case.rb', line 23 def controller_path @controller_path end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
19 20 21 |
# File 'actionview/lib/action_view/test_case.rb', line 19 def params @params end |
#request ⇒ Object
Returns the value of attribute request.
19 20 21 |
# File 'actionview/lib/action_view/test_case.rb', line 19 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
19 20 21 |
# File 'actionview/lib/action_view/test_case.rb', line 19 def response @response end |
Class Method Details
.controller_name ⇒ Object
30 31 32 |
# File 'actionview/lib/action_view/test_case.rb', line 30 def self.controller_name "test" end |
Instance Method Details
#controller_path=(path) ⇒ Object
26 27 28 |
# File 'actionview/lib/action_view/test_case.rb', line 26 def controller_path=(path) self.class.controller_path = path end |