From bb96ba13cf78c0bee1919c32e61bf0644c89a209 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 27 Jul 2017 22:13:49 +0900 Subject: [PATCH] Fallback to site_hostname when site_title is empty (#4394) --- app/helpers/instance_helper.rb | 2 +- spec/helpers/instance_helper_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/instance_helper.rb b/app/helpers/instance_helper.rb index a1c3c3521..70027cca9 100644 --- a/app/helpers/instance_helper.rb +++ b/app/helpers/instance_helper.rb @@ -2,7 +2,7 @@ module InstanceHelper def site_title - Setting.site_title.to_s + Setting.site_title.presence || site_hostname end def site_hostname diff --git a/spec/helpers/instance_helper_spec.rb b/spec/helpers/instance_helper_spec.rb index c3d28544f..bc5950d91 100644 --- a/spec/helpers/instance_helper_spec.rb +++ b/spec/helpers/instance_helper_spec.rb @@ -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