Class: ActionView::TestCase::TestController

Inherits:
ActionController::Base
  • Object
show all
Includes:
ActionDispatch::TestProcess
Defined in:
lib/action_view/test_case.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestController

Returns a new instance of TestController.



24
25
26
27
28
29
30
31
32
# File 'lib/action_view/test_case.rb', line 24

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.



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

def controller_path=(value)
  @controller_path = value
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



14
15
16
# File 'lib/action_view/test_case.rb', line 14

def params
  @params
end

#requestObject

Returns the value of attribute request.



14
15
16
# File 'lib/action_view/test_case.rb', line 14

def request
  @request
end

#responseObject

Returns the value of attribute response.



14
15
16
# File 'lib/action_view/test_case.rb', line 14

def response
  @response
end

Instance Method Details

#controller_path=(path) ⇒ Object



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

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