diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-29 14:39:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-29 14:39:20 -0700 |
commit | 76d75f42409a5711a772d78f67cb635b9b1e933a (patch) | |
tree | fdcca9c2ff548a8dcc05ab6456ab4d8451c1e142 /actionpack | |
parent | 82667c84e159fcb215780f8279c293612573b311 (diff) | |
download | rails-76d75f42409a5711a772d78f67cb635b9b1e933a.tar.gz rails-76d75f42409a5711a772d78f67cb635b9b1e933a.tar.bz2 rails-76d75f42409a5711a772d78f67cb635b9b1e933a.zip |
initialize ivars, refactor recycle! to call initialize
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 10 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 4ccb77992e..c4c825ba6b 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -220,15 +220,7 @@ module ActionController class TestResponse < ActionDispatch::TestResponse def recycle! - @status = 200 - @header = {} - @writer = lambda { |x| @body << x } - @block = nil - @length = 0 - @body = [] - @committed = false - @charset = @content_type = nil - @request = @template = nil + initialize end end diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index d590a23a81..5ef1c86967 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -74,6 +74,8 @@ module ActionDispatch # :nodoc: @blank = false @cv = new_cond @committed = false + @content_type = nil + @charset = nil if content_type = self[CONTENT_TYPE] type, charset = content_type.split(/;\s*charset=/) |