From 036a7a03cf4334c79f397d2a81b3df41047daf94 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Thu, 11 Feb 2016 22:44:46 +0100 Subject: Memoize `parsed_body`. It's common to use several assertions on the parsed response. The response bodies aren't meant to be mutated. People should make new test requests instead. Thus, it should be safe to memoize the parsing. --- actionpack/lib/action_dispatch/testing/test_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/testing/test_response.rb b/actionpack/lib/action_dispatch/testing/test_response.rb index 9d4b73a43d..4f289ad4b5 100644 --- a/actionpack/lib/action_dispatch/testing/test_response.rb +++ b/actionpack/lib/action_dispatch/testing/test_response.rb @@ -22,7 +22,7 @@ module ActionDispatch attr_writer :response_parser # :nodoc: def parsed_body - @parsed_body ||= @response_parser.call(body) + @response_parser.call(body) end end end -- cgit v1.2.3