diff options
author | Derek Prior <derekprior@gmail.com> | 2015-12-17 21:20:25 -0500 |
---|---|---|
committer | Derek Prior <derekprior@gmail.com> | 2015-12-17 21:20:25 -0500 |
commit | 31ef17a5ebf9bb414a20c9cf63c21ae8b8a39cd7 (patch) | |
tree | aa9017a5daf2cc142f9b2f276489a49482afddc4 /actionpack/test/assertions | |
parent | 7a6772c0e7acc10f4edad8ce3e6d401524ea1336 (diff) | |
download | rails-31ef17a5ebf9bb414a20c9cf63c21ae8b8a39cd7.tar.gz rails-31ef17a5ebf9bb414a20c9cf63c21ae8b8a39cd7.tar.bz2 rails-31ef17a5ebf9bb414a20c9cf63c21ae8b8a39cd7.zip |
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.
Diffstat (limited to 'actionpack/test/assertions')
-rw-r--r-- | actionpack/test/assertions/response_assertions_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |