initialize ivars, refactor recycle! to call initialize

This commit is contained in:
Aaron Patterson 2012-07-29 14:39:03 -07:00
parent 82667c84e1
commit 76d75f4240
2 changed files with 3 additions and 9 deletions

@ -220,15 +220,7 @@ def default_env
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

@ -74,6 +74,8 @@ def initialize(status = 200, header = {}, body = [])
@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=/)