Strip leading/trailing whitespace from pod tags list in social relay well known
Closes #6303
This commit is contained in:
parent
480384a077
commit
cb909c0d70
2 changed files with 3 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ class SocialRelayPresenter
|
||||||
|
|
||||||
def tags
|
def tags
|
||||||
return [] unless AppConfig.relay.inbound.scope == "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)
|
add_user_tags(tags)
|
||||||
tags.uniq
|
tags.uniq
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ describe SocialRelayPresenter do
|
||||||
|
|
||||||
describe "pod tags" do
|
describe "pod tags" do
|
||||||
before do
|
before do
|
||||||
AppConfig.relay.inbound.pod_tags = "foo,bar"
|
AppConfig.relay.inbound.pod_tags = "foo, bar"
|
||||||
AppConfig.relay.inbound.include_user_tags = false
|
AppConfig.relay.inbound.include_user_tags = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ describe SocialRelayPresenter do
|
||||||
|
|
||||||
describe "pod tags combined with user tags" do
|
describe "pod tags combined with user tags" do
|
||||||
before do
|
before do
|
||||||
AppConfig.relay.inbound.pod_tags = "foo,bar"
|
AppConfig.relay.inbound.pod_tags = "foo, bar"
|
||||||
AppConfig.relay.inbound.include_user_tags = true
|
AppConfig.relay.inbound.include_user_tags = true
|
||||||
ceetag = FactoryGirl.create(:tag, name: "cee")
|
ceetag = FactoryGirl.create(:tag, name: "cee")
|
||||||
lootag = FactoryGirl.create(:tag, name: "loo")
|
lootag = FactoryGirl.create(:tag, name: "loo")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue