require "rails_helper" RSpec.describe GovukDesignSystem::BreadcrumbsHelper, type: :helper do describe "#govukBreadcrumbs" do it "returns the correct HTML for the default example" do html = helper.govukBreadcrumbs({ items: [ { text: "Home", href: "#" }, { text: "Passports, travel and living abroad", href: "#" }, { text: "Travel abroad", href: "#" } ] }) expect(html).to match_html(<<~HTML)
  1. Home
  2. Passports, travel and living abroad
  3. Travel abroad
HTML end it "allows a collapsing on mobile" do html = helper.govukBreadcrumbs({ collapseOnMobile: true, items: [ { text: "Home", href: "#" }, { text: "Environment", href: "#" }, { text: "Rural and countryside", href: "#" }, { text: "Rural development and land management", href: "#" }, { text: "Economic growth in rural areas", href: "#" } ] }) expect(html).to match_html(<<~HTML)
  1. Home
  2. Environment
  3. Rural and countryside
  4. Rural development and land management
  5. Economic growth in rural areas
HTML end end end