Skip to content

Commit f803b4d

Browse files
committed
Moving featured blog posts component into the cms namespace
Addressed comments from review, and fixing a typo I found in test name
1 parent 68f4b7e commit f803b4d

File tree

8 files changed

+5
-7
lines changed

8 files changed

+5
-7
lines changed

app/components/featured_blog_posts_component.rb renamed to app/components/cms/featured_blog_posts_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class FeaturedBlogPostsComponent < ViewComponent::Base
3+
class Cms::FeaturedBlogPostsComponent < ViewComponent::Base
44
def initialize(number_to_display:, show_main_feature: true, title: "News and Updates")
55
@title = title
66
posts =

app/components/cms/horizontal_link_card_component.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def wrapper_classes
1414
classes = ["cms-horizontal-link-card white-bg"]
1515
if @theme
1616
classes << cms_color_theme_class(@theme, "left")
17-
classes << "#{@theme}-theme"
1817
end
1918
classes
2019
end

spec/components/featured_blog_posts_component_spec.rb renamed to spec/components/cms/featured_blog_posts_component_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "rails_helper"
22

3-
RSpec.describe FeaturedBlogPostsComponent, type: :component do
3+
RSpec.describe Cms::FeaturedBlogPostsComponent, type: :component do
44
context "when no posts" do
55
before do
66
stub_strapi_get_empty_collection_entity("blogs")

spec/components/cms/horizontal_link_card_component_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
it "should add theme classes" do
2424
expect(page).to have_css(".cms-color-theme__border--standard-left")
25-
expect(page).to have_css(".standard-theme")
2625
end
2726

2827
it "should render card content" do

spec/services/cms/dynamic_components/blocks/banner_with_cards_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@comp = Cms::Providers::Strapi::Factories::ComponentFactory.process_component(Cms::Mocks::DynamicComponents::Blocks::BannerWithCards.generate_raw_data)
66
end
77

8-
it "should render as FeaturedBlogPostsComponent" do
8+
it "should render as BannerWithCardsComponent" do
99
expect(@comp.render).to be_a(Cms::BannerWithCardsComponent)
1010
end
1111
end

spec/services/cms/dynamic_components/blocks/featured_blogs_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
stub_featured_posts
77
end
88

9-
it "should render as FeaturedBlogPostsComponent" do
10-
expect(@blogs.render).to be_a(FeaturedBlogPostsComponent)
9+
it "should render as Cms::FeaturedBlogPostsComponent" do
10+
expect(@blogs.render).to be_a(Cms::FeaturedBlogPostsComponent)
1111
end
1212
end

0 commit comments

Comments
 (0)