From 17fda24523f05a9cd5bc5115fd00cf55e33c0b4a Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 9 Nov 2009 16:24:54 -0500 Subject: [PATCH] Silence warning: instance variable @controller not initialized --- actionpack/lib/action_controller/test_case.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index d2059d51f45c2..62286ff3a20f6 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -105,6 +105,11 @@ module ActionController class TestCase < ActiveSupport::TestCase include TestProcess + def initialize(*args) + super + @controller = nil + end + module Assertions %w(response selector tag dom routing model).each do |kind| include ActionController::Assertions.const_get("#{kind.camelize}Assertions") @@ -195,7 +200,7 @@ def setup_controller_request_and_response @controller.send(:initialize_current_url) end end - + # Cause the action to be rescued according to the regular rules for rescue_action when the visitor is not local def rescue_action_in_public! @request.remote_addr = '208.77.188.166' # example.com