From 810837dda890a5bc5d0b4d65b973ca0ccc9465bd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 12 Dec 2011 19:45:16 -0800 Subject: use Array#join so that file encoding doesn't impact returned string. Fixes #3957 --- actionpack/test/dispatch/response_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/dispatch/response_test.rb') diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb index 337ece6b88..9bdd5ecbc6 100644 --- a/actionpack/test/dispatch/response_test.rb +++ b/actionpack/test/dispatch/response_test.rb @@ -5,6 +5,15 @@ class ResponseTest < ActiveSupport::TestCase @response = ActionDispatch::Response.new end + def test_response_body_encoding + # FIXME: remove this conditional on Rails 4.0 + return unless "<3".encoding_aware? + + body = ["hello".encode('utf-8')] + response = ActionDispatch::Response.new 200, {}, body + assert_equal Encoding::UTF_8, response.body.encoding + end + test "simple output" do @response.body = "Hello, World!" -- cgit v1.2.3