How to Get Production-like Error Responses in Your Rails Tests
In the Rails test environment, when your app responds with an error, it shows the detailed exception page. That’s ideal for unexpected errors, but for expected error responses that you want to write tests for, your app ought to respond as it would in production. Here’s a quick way to do it: https://www.wetestrails.com/blog/realistic-error-responses
Post a comment