Class: Brut::SpecSupport::Matchers::HaveGenerated

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

Overview

Matcher to check that a handler generated a specific page (as opposed to redirected to a page). This works for components as well, in the case of Ajax requests.

Examples:

result = handler.handle(form:)
expect(result).to have_generated(NewWidgetPage)

Ajax request

result = handler.handle(form:, xhr: true)
expect(result).to have_generated(WidgetResponseComponent)