aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/RUNNING_UNIT_TESTS.rdoc
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-02-10 21:46:51 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-02-10 21:46:51 +0100
commiteee3534b1a5614d824a34e2c761faaeab07c2eb4 (patch)
tree4de249ed1a91c151200d7d09355f3ba3e2bd44f8 /activerecord/RUNNING_UNIT_TESTS.rdoc
parent688996da7b25080a1a2ef74f5b4789f3e5eb670d (diff)
downloadrails-eee3534b1a5614d824a34e2c761faaeab07c2eb4.tar.gz
rails-eee3534b1a5614d824a34e2c761faaeab07c2eb4.tar.bz2
rails-eee3534b1a5614d824a34e2c761faaeab07c2eb4.zip
Add `parsed_body` to spare writing out parsing routines.
When testing: ```ruby post articles_path, params: { article: { title: 'Ahoy!' } }, as: :json ``` It's common to want to make assertions on the response body. Perhaps the server responded with JSON, so you write `JSON.parse(response.body)`. But that gets tedious real quick. Instead add `parsed_body` which will automatically parse the reponse body as what the last request was encoded `as`.
Diffstat (limited to 'activerecord/RUNNING_UNIT_TESTS.rdoc')
0 files changed, 0 insertions, 0 deletions