]> cat aescling's git repositories - mastodon.git/commitdiff
Fallback to site_hostname when site_title is empty (#4394)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Thu, 27 Jul 2017 13:13:49 +0000 (22:13 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 27 Jul 2017 13:13:49 +0000 (15:13 +0200)
app/helpers/instance_helper.rb
spec/helpers/instance_helper_spec.rb

index a1c3c3521f9d92b010b1e8c343fd9bcb7fae6216..70027cca9183f3972cf6e02f09ee4b0b6a80e72f 100644 (file)
@@ -2,7 +2,7 @@
 
 module InstanceHelper
   def site_title
-    Setting.site_title.to_s
+    Setting.site_title.presence || site_hostname
   end
 
   def site_hostname
index c3d28544f2ddab78b69be6d10dd814fa58d7a09d..bc5950d91ce1e9f0713ec6534bff7e6ef2f8f2b8 100644 (file)
@@ -19,7 +19,7 @@ describe InstanceHelper do
     it 'returns empty string when Setting.site_title is nil' do
       Setting.site_title = nil
 
-      expect(helper.site_title).to eq ''
+      expect(helper.site_title).to eq 'cb6e6126.ngrok.io'
     end
   end