Created
June 3, 2011 10:38
-
-
Save raine/1006155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :respond_with_json do |expected| | |
match do |actual| | |
JSON.parse(actual.response.body) == expected | |
end | |
failure_message_for_should do |actual| | |
"expected the response #{actual.response.body} to be #{expected}" | |
end | |
end |
Author
raine
commented
Jun 3, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment