From 31ef17a5ebf9bb414a20c9cf63c21ae8b8a39cd7 Mon Sep 17 00:00:00 2001 From: Derek Prior Date: Thu, 17 Dec 2015 21:20:25 -0500 Subject: Fix "instance variable not initialized" in tests The ActionPack test suite had a handful of these warnings when run. This was due to `assert_response` being tested outside the context of a controller instance where those instance variables would already have been initialized. --- actionpack/test/assertions/response_assertions_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actionpack/test/assertions/response_assertions_test.rb b/actionpack/test/assertions/response_assertions_test.rb index e76c222824..841fa6aaad 100644 --- a/actionpack/test/assertions/response_assertions_test.rb +++ b/actionpack/test/assertions/response_assertions_test.rb @@ -19,6 +19,11 @@ module ActionDispatch end end + def setup + @controller = nil + @request = nil + end + def test_assert_response_predicate_methods [:success, :missing, :redirect, :error].each do |sym| @response = FakeResponse.new RESPONSE_PREDICATES[sym].to_s.sub(/\?/, '').to_sym -- cgit v1.2.3