From 1b74047c4f5c91fb65b719a23639dbb3abac8f45 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 30 May 2017 19:29:48 +0900 Subject: [PATCH] Use around hook to restore context in ApplicationHelper spec (#3432) --- spec/helpers/application_helper_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index a3903464b4..7b875e21f4 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -100,6 +100,12 @@ describe ApplicationHelper do end describe 'title' do + around do |example| + site_title = Setting.site_title + example.run + Setting.site_title = site_title + end + it 'returns site title on production enviroment' do Setting.site_title = 'site title' expect(Rails.env).to receive(:production?).and_return(true)