Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

prevent caching the decoded response across test requests

  • Loading branch information...
commit db539dcc8e03c662f40967ed9fa570064292b8b9 1 parent abffe3a
@nagash nagash authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/rocket_pants/test_helper.rb
View
7 lib/rocket_pants/test_helper.rb
@@ -13,6 +13,10 @@ module TestHelper
end
module ResponseHelper
+
+ def recycle_cached_body!
+ @_parsed_body = @_decoded_body = nil
+ end
def parsed_body
@_parsed_body ||= begin
@@ -70,6 +74,7 @@ def have_decoded_response(value)
# Like process, but automatically adds the api version.
def process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
+ response.recycle_cached_body!
parameters ||= {}
if _default_version.present? && parameters[:version].blank? && parameters['version'].blank?
parameters[:version] = _default_version
@@ -91,4 +96,4 @@ def normalise_value(value)
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.