Sha256: 145bebe9d7735e5d0e4eab0409c0ffb8400f3c68c96151cfb5950bb3968dbbf7
Contents?: true
Size: 1.18 KB
Versions: 20
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require "spec_helper" module Decidim module Admin describe AriaSelectedLinkToHelper do let(:options) { {} } subject do Nokogiri::HTML( helper.aria_selected_link_to("Text", "url", options) ) end context "with options" do let(:options) { { class: "my_class" } } it "still uses the options hash" do expect(subject.css("a[class='my_class']")).not_to be_empty end end context "when it's ponting to the current path" do before do expect(helper) .to receive(:is_active_link?) .and_return true end it "adds the attribute with 'true' as value" do expect(subject.css("a[href='url'][aria-selected='true']")).not_to be_empty end end context "when it's ponting to the current path" do before do expect(helper) .to receive(:is_active_link?) .and_return false end it "adds the attribute with 'false' as value" do expect(subject.css("a[href='url'][aria-selected='false']")).not_to be_empty end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems