From cb909c0d704e1cb27ddd906ead42b7946258ceb5 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Sun, 9 Aug 2015 00:33:35 +0300 Subject: [PATCH] Strip leading/trailing whitespace from pod tags list in social relay well known Closes #6303 --- app/presenters/social_relay_presenter.rb | 2 +- spec/presenters/social_relay_presenter_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/presenters/social_relay_presenter.rb b/app/presenters/social_relay_presenter.rb index eab42a4f3..8d240b923 100644 --- a/app/presenters/social_relay_presenter.rb +++ b/app/presenters/social_relay_presenter.rb @@ -9,7 +9,7 @@ class SocialRelayPresenter def tags return [] unless AppConfig.relay.inbound.scope == "tags" - tags = AppConfig.relay.inbound.pod_tags.present? ? AppConfig.relay.inbound.pod_tags.split(",") : [] + tags = AppConfig.relay.inbound.pod_tags.present? ? AppConfig.relay.inbound.pod_tags.split(",").map(&:strip) : [] add_user_tags(tags) tags.uniq end diff --git a/spec/presenters/social_relay_presenter_spec.rb b/spec/presenters/social_relay_presenter_spec.rb index 27d132994..d5932864d 100644 --- a/spec/presenters/social_relay_presenter_spec.rb +++ b/spec/presenters/social_relay_presenter_spec.rb @@ -25,7 +25,7 @@ describe SocialRelayPresenter do describe "pod tags" do before do - AppConfig.relay.inbound.pod_tags = "foo,bar" + AppConfig.relay.inbound.pod_tags = "foo, bar" AppConfig.relay.inbound.include_user_tags = false end @@ -61,7 +61,7 @@ describe SocialRelayPresenter do describe "pod tags combined with user tags" do before do - AppConfig.relay.inbound.pod_tags = "foo,bar" + AppConfig.relay.inbound.pod_tags = "foo, bar" AppConfig.relay.inbound.include_user_tags = true ceetag = FactoryGirl.create(:tag, name: "cee") lootag = FactoryGirl.create(:tag, name: "loo")