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)
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) HTML end end end