aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/test_response_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/test_response_test.rb')
-rw-r--r--actionpack/test/dispatch/test_response_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/test_response_test.rb b/actionpack/test/dispatch/test_response_test.rb
index a4f9d56a6a..72e06b4590 100644
--- a/actionpack/test/dispatch/test_response_test.rb
+++ b/actionpack/test/dispatch/test_response_test.rb
@@ -17,4 +17,12 @@ class TestResponseTest < ActiveSupport::TestCase
assert_response_code_range 500..599, :server_error?
assert_response_code_range 400..499, :client_error?
end
+
+ test "response parsing" do
+ response = ActionDispatch::TestResponse.create(200, {}, '')
+ assert_equal response.body, response.parsed_body
+
+ response = ActionDispatch::TestResponse.create(200, { 'Content-Type' => 'application/json' }, '{ "foo": "fighters" }')
+ assert_equal({ 'foo' => 'fighters' }, response.parsed_body)
+ end
end