Use Setting.site_title value for `og:site_name` occurrences (#1194)
* Add helper method to return Setting.site_title * Use site_title helper in application layout * Use site_title value for og:site_namemaster
parent
a345eb44fc
commit
ca44c13455
@ -0,0 +1,7 @@ |
|||||||
|
# frozen_string_literal: true |
||||||
|
|
||||||
|
module SiteTitleHelper |
||||||
|
def site_title |
||||||
|
Setting.site_title.to_s |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,15 @@ |
|||||||
|
require "rails_helper" |
||||||
|
|
||||||
|
describe "site_title" do |
||||||
|
it "Uses the Setting.site_title value when it exists" do |
||||||
|
Setting.site_title = "New site title" |
||||||
|
|
||||||
|
expect(helper.site_title).to eq "New site title" |
||||||
|
end |
||||||
|
|
||||||
|
it "returns empty string when Setting.site_title is nil" do |
||||||
|
Setting.site_title = nil |
||||||
|
|
||||||
|
expect(helper.site_title).to eq "" |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue