Class Index [+]

Quicksearch

ActionController::TestCase::Behavior::ClassMethods

Public Instance Methods

controller_class() click to toggle source
     # File lib/action_controller/test_case.rb, line 366
366:         def controller_class
367:           if current_controller_class = self._controller_class
368:             current_controller_class
369:           else
370:             self.controller_class = determine_default_controller_class(name)
371:           end
372:         end
controller_class=(new_class) click to toggle source
     # File lib/action_controller/test_case.rb, line 361
361:         def controller_class=(new_class)
362:           prepare_controller_class(new_class) if new_class
363:           self._controller_class = new_class
364:         end
determine_default_controller_class(name) click to toggle source
     # File lib/action_controller/test_case.rb, line 374
374:         def determine_default_controller_class(name)
375:           name.sub(/Test$/, '').safe_constantize
376:         end
prepare_controller_class(new_class) click to toggle source
     # File lib/action_controller/test_case.rb, line 378
378:         def prepare_controller_class(new_class)
379:           new_class.send :include, ActionController::TestCase::RaiseActionExceptions
380:         end
tests(controller_class) click to toggle source

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 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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.