Simplify article publisher URL
We've been using the `url` Setting for a long time, but since then we've added a few references to `root_url` to this file, so we're now adding consistency. We're also removing a now unnecessary condition.
This commit is contained in:
@@ -8,9 +8,7 @@
|
||||
<meta name="twitter:image" content="<%= root_url + (local_assigns[:twitter_image_url] || "social_media_icon_twitter.png") %>" />
|
||||
<!-- Facebook OG -->
|
||||
<meta id="ogtitle" property="og:title" content="<%= local_assigns[:social_title] || setting["meta_title"] %>" />
|
||||
<% if setting["url"] %>
|
||||
<meta property="article:publisher" content="<%= setting["url"] %>" />
|
||||
<% end %>
|
||||
<meta property="article:publisher" content="<%= root_url %>" />
|
||||
<% if setting["facebook_handle"] %>
|
||||
<meta property="article:author" content="https://www.facebook.com/<%= setting["facebook_handle"] %>" />
|
||||
<% end %>
|
||||
|
||||
@@ -8,7 +8,6 @@ describe "Social media meta tags" do
|
||||
"Citizen participation tool for an open, transparent and democratic government."
|
||||
end
|
||||
let(:twitter_handle) { "@consul_test" }
|
||||
let(:url) { "http://consul.dev" }
|
||||
let(:facebook_handle) { "consultest" }
|
||||
let(:org_name) { "CONSUL TEST" }
|
||||
|
||||
@@ -17,7 +16,6 @@ describe "Social media meta tags" do
|
||||
Setting["meta_title"] = meta_title
|
||||
Setting["meta_description"] = meta_description
|
||||
Setting["twitter_handle"] = twitter_handle
|
||||
Setting["url"] = url
|
||||
Setting["facebook_handle"] = facebook_handle
|
||||
Setting["org_name"] = org_name
|
||||
end
|
||||
@@ -30,7 +28,7 @@ describe "Social media meta tags" do
|
||||
expect(page).to have_meta "twitter:description", with: meta_description
|
||||
expect(page).to have_meta "twitter:image", with: "#{app_host}/social_media_icon_twitter.png"
|
||||
expect(page).to have_property "og:title", with: meta_title
|
||||
expect(page).to have_property "article:publisher", with: url
|
||||
expect(page).to have_property "article:publisher", with: "#{app_host}/"
|
||||
expect(page).to have_property "article:author", with: "https://www.facebook.com/#{facebook_handle}"
|
||||
expect(page).to have_property "og:url", with: "#{app_host}/"
|
||||
expect(page).to have_property "og:image", with: "#{app_host}/social_media_icon.png"
|
||||
|
||||
Reference in New Issue
Block a user