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
I
R
Class Public methods
included(base)
# File actionpack/lib/action_controller/test_case.rb, line 135
def self.included(base)
  base.class_eval do
    attr_accessor :exception
    protected :exception, :exception=
  end
end
Instance Protected methods
rescue_action_without_handler(e)
# File actionpack/lib/action_controller/test_case.rb, line 143
def rescue_action_without_handler(e)
  self.exception = e
  if request.remote_addr == "0.0.0.0"
    raise(e)
  else
    super(e)
  end
end