Class: ActionView::TestCase::TestController

Inherits:
ActionController::Base show all
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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActionDispatch::TestProcess

#assigns, #cookies, #flash, #redirect_to_url, #session

Methods included from ActionDispatch::TestProcess::FixtureFile

#fixture_file_upload

Methods inherited from ActionController::Base

without_modules

Methods inherited from ActionController::Metal

action, binary_params_for?, controller_name, #controller_name, #dispatch, dispatch, inherited, make_response!, middleware, #performed?, #reset_session, #response_body=, #set_request!, #set_response!, #to_a, #url_for, use

Methods included from ActionController::Testing::Functional

#recycle!

Methods inherited from AbstractController::Base

abstract!, action_methods, #action_methods, #action_name, #available_action?, clear_action_methods!, controller_path, #controller_path, #formats, inherited, internal_methods, method_added, #performed?, #process, #response_body, supports_path?

Methods included from ActiveSupport::DescendantsTracker

clear, #descendants, descendants, #direct_descendants, direct_descendants, #inherited, store_inherited

Methods included from ActiveSupport::Configurable

#config

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Constructor Details

#initializeTestController

Returns a new instance of TestController.


26
27
28
29
30
31
32
33
34
# File 'actionview/lib/action_view/test_case.rb', line 26

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=(value) ⇒ Object (writeonly)

Sets the attribute controller_path

Parameters:

  • value

    the value to set the attribute controller_path to.


19
20
21
# File 'actionview/lib/action_view/test_case.rb', line 19

def controller_path=(value)
  @controller_path = value
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params


16
17
18
# File 'actionview/lib/action_view/test_case.rb', line 16

def params
  @params
end

#requestObject

Returns the value of attribute request


16
17
18
# File 'actionview/lib/action_view/test_case.rb', line 16

def request
  @request
end

#responseObject

Returns the value of attribute response


16
17
18
# File 'actionview/lib/action_view/test_case.rb', line 16

def response
  @response
end

Instance Method Details

#controller_path=(path) ⇒ Object


22
23
24
# File 'actionview/lib/action_view/test_case.rb', line 22

def controller_path=(path)
  self.class.controller_path = (path)
end