aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-02-11 22:44:46 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-02-11 22:47:18 +0100
commit036a7a03cf4334c79f397d2a81b3df41047daf94 (patch)
tree2f17fe8d1224558b5f2295de24a2ca0e81254efb /actionpack
parent5007df5ea53efaf7d8f14994bea6bc3e0adc67f6 (diff)
downloadrails-036a7a03cf4334c79f397d2a81b3df41047daf94.tar.gz
rails-036a7a03cf4334c79f397d2a81b3df41047daf94.tar.bz2
rails-036a7a03cf4334c79f397d2a81b3df41047daf94.zip
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.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/testing/test_response.rb2
1 files changed, 1 insertions, 1 deletions
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