]> cat aescling's git repositories - mastodon.git/commitdiff
Use around hook to restore context in ApplicationHelper spec (#3432)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Tue, 30 May 2017 10:29:48 +0000 (19:29 +0900)
committerMatt Jankowski <mjankowski@thoughtbot.com>
Tue, 30 May 2017 10:29:48 +0000 (06:29 -0400)
spec/helpers/application_helper_spec.rb

index a3903464b466faa694f937546630e1845b8d1767..7b875e21f46d82f70ed7d194a7c12423de8e4093 100644 (file)
@@ -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)