about summary refs log tree commit diff
path: root/spec/helpers
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-08 06:15:40 -0400
committerEugen <eugen@zeonfederated.com>2017-04-08 12:15:40 +0200
commitca44c134554585ac4fe5dfa301f82697224ded9d (patch)
tree2ea21342a7f5d7f0983c3287167c2d34357b67f2 /spec/helpers
parenta345eb44fc502a0f255d1017313342649e8d4ee0 (diff)
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_name
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/site_title_helper_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/helpers/site_title_helper_spec.rb b/spec/helpers/site_title_helper_spec.rb
new file mode 100644
index 000000000..8cfd9cba1
--- /dev/null
+++ b/spec/helpers/site_title_helper_spec.rb
@@ -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