Module ActionController::TestCase::RaiseActionExceptions
In: vendor/rails/actionpack/lib/action_controller/test_case.rb

When the request.remote_addr remains the default for testing, which is 0.0.0.0, the exception is simply raised inline (bystepping 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.

Methods

Attributes

exception  [RW] 

Public Instance methods

[Source]

    # File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 28
28:       def rescue_action(e)
29:         self.exception = e
30:         
31:         if request.remote_addr == "0.0.0.0"
32:           raise(e)
33:         else
34:           super(e)
35:         end
36:       end

[Validate]