Methods
- controller_class
- controller_class=
- determine_default_controller_class
- prepare_controller_class
- rescue_action_in_public!
- setup_controller_request_and_response
- tests
Classes and Modules
Module ActionController::TestCase::RaiseActionExceptionsPublic Class methods
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 53
53: def controller_class
54: if current_controller_class = read_inheritable_attribute(:controller_class)
55: current_controller_class
56: else
57: self.controller_class = determine_default_controller_class(name)
58: end
59: end
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 48
48: def controller_class=(new_class)
49: prepare_controller_class(new_class)
50: write_inheritable_attribute(:controller_class, new_class)
51: end
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 61
61: def determine_default_controller_class(name)
62: name.sub(/Test$/, '').constantize
63: rescue NameError
64: raise NonInferrableControllerError.new(name)
65: end
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 67
67: def prepare_controller_class(new_class)
68: new_class.send :include, RaiseActionExceptions
69: end
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 44
44: def tests(controller_class)
45: self.controller_class = controller_class
46: end
Public Instance methods
Cause the action to be rescued according to the regular rules for rescue_action when the visitor is not local
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 79
79: def rescue_action_in_public!
80: @request.remote_addr = '208.77.188.166' # example.com
81: end
[ show source ]
# File actionpack/lib/action_controller/test_case.rb, line 72
72: def setup_controller_request_and_response
73: @controller = self.class.controller_class.new
74: @controller.request = @request = TestRequest.new
75: @response = TestResponse.new
76: end