Class: Brut::SpecSupport::Matchers::HaveReturnedHttpStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/brut/spec_support/matchers/have_returned_http_status.rb

Overview

Used on handler specs to check that a response returned a particular HTTP status code. Can also be used with ComponentSupport#generate_result to check that a Page's FrontEnd::Page#before_generate method did what you expect

Examples:

result = handler.handle
expect(result).to have_returned_http_status(404)

dont' care what status, just that one was returned instead of a page generation

result = handler.handle
expect(result).to have_returned_http_status

testing a before_generate method

result = generate_result(page)
expect(result).to have_returned_http_status(403)