Files
old-holivud2/spec/helpers/cards_helper_spec.rb
2020-05-31 22:38:19 +02:00

24 lines
593 B
Ruby

require "rails_helper"
RSpec.describe CardsHelper, type: :helper do
describe "#card_header" do
it "includes a heading element" do
header = helper.card_header(text: "Foo")
expect(header).to have_css "h1", text: "Foo"
end
it "includes subtext when present" do
header = helper.card_header(subtext: "Bar")
expect(header).to have_css "small", text: "Bar"
end
it "includes close button when present" do
header = helper.card_header(close_action_path: "/foo")
expect(header).to have_css "a[href='/foo']", text: "Close"
end
end
end