Method: RSpec::Rails::Matchers#have_http_status
- Defined in:
- lib/rspec/rails/matchers/have_http_status.rb
#have_http_status(target) ⇒ Object
Passes if response has a matching HTTP status code.
The following symbolic status codes are allowed:
Rack::Utils::SYMBOL_TO_STATUS_CODE- One of the defined
ActionDispatch::TestResponsealiases::error:missing:redirect:success
374 375 376 377 378 |
# File 'lib/rspec/rails/matchers/have_http_status.rb', line 374 def have_http_status(target) raise ArgumentError, "Invalid HTTP status: nil" unless target HaveHttpStatus.matcher_for_status(target) end |