class ShowExceptions::ShowFailsafeExceptionsTest

Public Instance Methods

test_render_failsafe_exception() click to toggle source
# File actionpack/test/controller/show_exceptions_test.rb, line 100
def test_render_failsafe_exception
  @app = ShowExceptionsOverriddenController.action(:boom)
  @exceptions_app = @app.instance_variable_get(:@exceptions_app)
  @app.instance_variable_set(:@exceptions_app, nil)
  $stderr = StringIO.new

  get "/", headers: { "HTTP_ACCEPT" => "text/json" }
  assert_response :internal_server_error
  assert_equal "text/plain", response.content_type.to_s
ensure
  @app.instance_variable_set(:@exceptions_app, @exceptions_app)
  $stderr = STDERR
end