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

Class Method 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 included from ActionController::Testing::Functional

#clear_instance_variables_between_requests, #recycle!

Constructor Details

#initializeTestController

Returns a new instance of TestController.



31
32
33
34
35
36
37
38
39
# File 'actionview/lib/action_view/test_case.rb', line 31

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_pathObject

Overrides AbstractController::Base#controller_path



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

def controller_path
  @controller_path
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

Class Method Details

.controller_nameObject



27
28
29
# File 'actionview/lib/action_view/test_case.rb', line 27

def self.controller_name
  "test"
end

Instance Method Details

#controller_path=(path) ⇒ Object



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

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