Fix status initialization when custom status provided

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Krekoten' Marjan 2010-10-18 22:00:48 +03:00 committed by Santiago Pastorino
parent 608bf7b72c
commit a75d21df06
2 changed files with 6 additions and 2 deletions

View File

@ -44,8 +44,8 @@ module ActionDispatch # :nodoc:
@block = nil
@length = 0
@status, @header = status, header
self.body = body
@header = header
self.body, self.status = body, status
@cookie = []
@sending_file = false

View File

@ -18,6 +18,10 @@ class ResponseTest < ActiveSupport::TestCase
body.each { |part| parts << part }
assert_equal ["Hello, World!"], parts
end
test "status handled properly in initialize" do
assert_equal 200, ActionDispatch::Response.new('200 OK').status
end
test "utf8 output" do
@response.body = [1090, 1077, 1089, 1090].pack("U*")