From 291b4780502a1b993722e899c24683be55a405eb Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 28 Jan 2022 14:27:02 +0100 Subject: [PATCH] Fix typo for "instagram" This typo was accidentally introduced in commit 3b00f3c141. --- app/components/layout/social_component.rb | 2 +- spec/components/layout/social_component_spec.rb | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/components/layout/social_component.rb b/app/components/layout/social_component.rb index 779b47cc2..108e3f066 100644 --- a/app/components/layout/social_component.rb +++ b/app/components/layout/social_component.rb @@ -13,7 +13,7 @@ class Layout::SocialComponent < ApplicationComponent facebook: "https://www.facebook.com", youtube: "https://www.youtube.com", telegram: "https://www.telegram.me", - instragram: "https://www.instagram.com" + instagram: "https://www.instagram.com" }.select { |name, _| setting["#{name}_handle"].present? } end diff --git a/spec/components/layout/social_component_spec.rb b/spec/components/layout/social_component_spec.rb index e3956e215..1bd0cd16f 100644 --- a/spec/components/layout/social_component_spec.rb +++ b/spec/components/layout/social_component_spec.rb @@ -3,11 +3,21 @@ require "rails_helper" describe Layout::SocialComponent do describe "#render?" do it "renders when a social setting is present" do - Setting["twitter_handle"] = "myhandle" + Setting["twitter_handle"] = "my_twitter_handle" + Setting["facebook_handle"] = "my_facebook_handle" + Setting["youtube_handle"] = "my_youtube_handle" + Setting["telegram_handle"] = "my_telegram_handle" + Setting["instagram_handle"] = "my_instagram_handle" + Setting["org_name"] = "CONSUL" render_inline Layout::SocialComponent.new expect(page).to have_css "ul" + expect(page).to have_link "CONSUL Twitter", href: "https://twitter.com/my_twitter_handle" + expect(page).to have_link "CONSUL Facebook", href: "https://www.facebook.com/my_facebook_handle" + expect(page).to have_link "CONSUL YouTube", href: "https://www.youtube.com/my_youtube_handle" + expect(page).to have_link "CONSUL Telegram", href: "https://www.telegram.me/my_telegram_handle" + expect(page).to have_link "CONSUL Instagram", href: "https://www.instagram.com/my_instagram_handle" end it "renders when a content block is present" do