From 1d37d349de0f9ca39955929eefda04ff02b35ea4 Mon Sep 17 00:00:00 2001 From: Diego Toral Date: Wed, 7 Feb 2024 11:20:13 -0800 Subject: [PATCH] Create basic Bulma::SubtitleComponent --- app/components/bulma/subtitle_component.rb | 9 +++++++++ spec/components/bulma/subtitle_component_spec.rb | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 app/components/bulma/subtitle_component.rb create mode 100644 spec/components/bulma/subtitle_component_spec.rb 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