Class Index [+]

Quicksearch

ActionController::TestCase::RaiseActionExceptions

When the request.remote_addr remains the default for testing, which is 0.0.0.0, the exception is simply raised inline (skipping the regular exception handling from rescue_action). If the request.remote_addr is anything else, the regular rescue_action process takes place. This means you can test your rescue_action code by setting remote_addr to something else than 0.0.0.0.

The exception is stored in the exception accessor for further inspection.

Public Class Methods

included(base) click to toggle source
     # File lib/action_controller/test_case.rb, line 471
471:       def self.included(base)
472:         base.class_eval do
473:           attr_accessor :exception
474:           protected :exception, :exception=
475:         end
476:       end

Protected Instance Methods

rescue_action_without_handler(e) click to toggle source
     # File lib/action_controller/test_case.rb, line 479
479:         def rescue_action_without_handler(e)
480:           self.exception = e
481: 
482:           if request.remote_addr == "0.0.0.0"
483:             raise(e)
484:           else
485:             super(e)
486:           end
487:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.