diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-31 23:03:19 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-10 01:31:27 -0400 |
commit | 1f9a2ab7c9faf9b3a5fcc2a8ea695efee2314196 (patch) | |
tree | 0b9f531dcffb5b1041da19c844a9c48ad3dc15a9 | |
parent | 33df3ed384563b1e302e5a4f2186b156c35bafc5 (diff) | |
download | gitlab-ce-1f9a2ab7c9faf9b3a5fcc2a8ea695efee2314196.tar.gz |
Memoize result of JSON.parse in json_response
This might see a minor speedup in test cases that call this method many
times.
-rw-r--r-- | spec/support/api_helpers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/support/api_helpers.rb b/spec/support/api_helpers.rb index ec9a326a1ea..f63322776d4 100644 --- a/spec/support/api_helpers.rb +++ b/spec/support/api_helpers.rb @@ -29,6 +29,6 @@ module ApiHelpers end def json_response - JSON.parse(response.body) + @_json_response ||= JSON.parse(response.body) end end |