Last active
August 29, 2015 13:56
-
-
Save jumski/8932868 to your computer and use it in GitHub Desktop.
Sending invalid json in request specs
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
it 'responds properly when invalid json was sent' do | |
send method, path, '{invalid_json]', | |
'CONTENT_TYPE' => 'application/json', | |
'ACCEPT' => 'application/json' | |
expect(response.code.to_i).to eq 400 | |
expect(JSON.parse(response.body)).to equal({'message' => 'Problems parsing JSON'}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment