# File lib/action_controller/test_case.rb, line 328 def controller_class if current_controller_class = read_inheritable_attribute(:controller_class) current_controller_class else self.controller_class = determine_default_controller_class(name) end end
# File lib/action_controller/test_case.rb, line 323 def controller_class=(new_class) prepare_controller_class(new_class) if new_class write_inheritable_attribute(:controller_class, new_class) end
# File lib/action_controller/test_case.rb, line 336 def determine_default_controller_class(name) name.sub(/Test$/, '').constantize rescue NameError nil end
# File lib/action_controller/test_case.rb, line 342 def prepare_controller_class(new_class) new_class.send :include, ActionController::TestCase::RaiseActionExceptions end
Sets the controller class name. Useful if the name can't be inferred from test class. Expects controller_class as a constant. Example: tests WidgetController.
# File lib/action_controller/test_case.rb, line 319 def tests(controller_class) self.controller_class = controller_class end
Generated with the Darkfish Rdoc Generator 2.