How to use HTTP status code symbols in RSpec?
The response object responds to several of the symbol types as messages. So you can simply do: expect(response).to be_success expect(response).to be_error expect(response).to be_missing expect(response).to be_redirect For the other types, such as :created, you can create a simple custom matcher for this which wraps assert_response: RSpec::Matchers.define :have_status do |type, message = nil| match do |_response| assert_response … Read more