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.
Methods
Class Public methods
# File actionpack/lib/action_controller/test_case.rb, line 531 531: def self.included(base) 532: unless base.method_defined?(:exception) && base.method_defined?(:exception=) 533: base.class_eval do 534: attr_accessor :exception 535: protected :exception, :exception= 536: end 537: end 538: end
Instance Protected methods