Hi Joseph TL;DR because rails does.
Partly because we take the lead from rails here and provide only some fuzzing around the versions to provide consistency… Rails takes this strict approach because only 404 is missing, most of the other 4xx status codes are other kinds of client errors. I suppose you could argue that 410 (Gone) is missing, but then we get into semantic errors. I can assure you that 401 / 403 is not missing, nor 405 and most definitely not 418. Even if I do sometimes misplace the teapot. Cheers Jon Rowe --------------------------- [email protected] jonrowe.co.uk On 26 February 2020 at 15:01, Joseph Haig wrote: > I am looking at the documentation for the have_http_status matcher here - > https://www.rubydoc.info/gems/rspec-rails/RSpec%2FRails%2FMatchers:have_http_status > - and I see that there are options to match for 2xx (:success), 3xx > (:redirect) and 5xx (:error) but if I use :missing then it matches exactly on > a 404 status. Is there any particular reason why there isn't an option for > matching a status in the range 400-499? Thanks. > > Regards, > > Joe -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/dejalu-217-e06f5c2a-aae8-45d0-b63d-12c064648ed3%40jonrowe.co.uk.
