Initial commit
This commit is contained in:
23
spec/helpers/cards_helper_spec.rb
Normal file
23
spec/helpers/cards_helper_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
Reference in New Issue
Block a user