Skip to content

Instantly share code, notes, and snippets.

@mbleigh
Forked from jch/gist:1384826
Created November 22, 2011 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbleigh/1384828 to your computer and use it in GitHub Desktop.
Save mbleigh/1384828 to your computer and use it in GitHub Desktop.
Object.pathy!
def response
last_response.stub!(:parsed_body).and_return(MultiJson.decode(last_response.body))
last_response
end
def body(path = nil)
if path
response.parsed_body.at_json_path(path)
else
response.parsed_body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment