Class: Brut::SpecSupport::Matchers::HaveLinkTo

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

Overview

Used on a component/page spec to check that there is a link to a specific routing. This handles creating a CSS selector like [href="#{page_klass.routing(**args)}"].

Examples:

result = generate_and_parse(page)
expect(result.e!("nav")).to have_link_to(HomePage)

link with parameters

result = generate_and_parse(page)
expect(result.e!("nav")).to have_link_to(WidgetsByWidgetIdPage, id: widget.id)