diff --git a/app/components/bulma/subtitle_component.rb b/app/components/bulma/subtitle_component.rb new file mode 100644 index 0000000..0b97961 --- /dev/null +++ b/app/components/bulma/subtitle_component.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Bulma + class SubtitleComponent < Component + def call + content_tag :p, nil, class: "subtitle" + end + end +end diff --git a/spec/components/bulma/subtitle_component_spec.rb b/spec/components/bulma/subtitle_component_spec.rb new file mode 100644 index 0000000..0186af0 --- /dev/null +++ b/spec/components/bulma/subtitle_component_spec.rb @@ -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