I use HTTP status code symbols in code in a controller such as:
render json: {
auth_token: user.authentication_t
On the one hand, response is built with methods like:
success?
redirect?
unprocessable?
full list do: response.methods.grep(/\?/)
On the other hand, Rspec predicates transforms every foo? method to a be_foo matcher.
Not sure you can have the 201 this way unfortunately, but creating a custom matcher is quite easy.
Note Rails test only rely on a few statuses.