Rspec check for get / post error responses
I am trying to check the HTTP GET error message and cannot find any information or examples of this
Expected error response:
{
"success": false,
"code": 400,
"message": "ERROR: This is the specific error message"
}
This raises a "bad request", but how do you check the "message" in the body of the error response?
expect {get "<url that generates a bad request>"}.to raise_error(/400 Bad Request/)
Thanks in advance for your understanding!
+3
source to share