commit: 2d39560dc1811c29c1663b11a4a351089898e244
parent: c49ff7395e911c4254d75ec29702af34d07508a7
Author: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Date: Tue, 30 May 2017 19:29:48 +0900
Use around hook to restore context in ApplicationHelper spec (#3432)
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git 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)