Methods
- C
- D
- P
- T
Instance Public methods
Sets the controller class name. Useful if the name can’t be inferred from test class. Normalizes controller_class before using. Examples:
tests WidgetController tests :widget tests 'widget'
# File actionpack/lib/action_controller/test_case.rb, line 350 350: def tests(controller_class) 351: case controller_class 352: when String, Symbol 353: self.controller_class = "#{controller_class.to_s.underscore}_controller".camelize.constantize 354: when Class 355: self.controller_class = controller_class 356: else 357: raise ArgumentError, "controller class must be a String, Symbol, or Class" 358: end 359: end