Nutzbar wie folgt:
response.should have_status "Found" # 302
response.should have_status "Bad Gateway" # 502
RSpec::Matchers.define :have_status do |expected_status| | |
match do |response| | |
status_code = Rack::Utils.status_code(expected_status.downcase.gsub(/\s|-/, '_').to_sym) | |
response.status == status_code | |
end | |
end |