Skip to content

Commit

Permalink
Create basic Bulma::SubtitleComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
diegotoral committed Feb 7, 2024
1 parent 7c9fd99 commit 1d37d34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/components/bulma/subtitle_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Bulma
class SubtitleComponent < Component
def call
content_tag :p, nil, class: "subtitle"
end
end
end
9 changes: 9 additions & 0 deletions spec/components/bulma/subtitle_component_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

RSpec.describe Bulma::SubtitleComponent, type: :component do
it "renders a p tag by default" do
render_inline(described_class.new)

expect(page).to have_css "p.subtitle"
end
end

0 comments on commit 1d37d34

Please sign in to comment.