about summary refs log tree commit diff
path: root/spec/controllers/admin
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-04 14:53:39 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-04 20:53:39 +0200
commit84eb425f385c5fc66dc67973b2869b9f31e9a2bb (patch)
treee8854172a1b6ca9d187bccfe44f1034fe4643405 /spec/controllers/admin
parenta50a87457e81f9b3d02733c22174cd05f69f1254 (diff)
Remove redis clear from before in spec (#2795)
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r--spec/controllers/admin/settings_controller_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/controllers/admin/settings_controller_spec.rb b/spec/controllers/admin/settings_controller_spec.rb
index 533ae2045..7fd49a0f1 100644
--- a/spec/controllers/admin/settings_controller_spec.rb
+++ b/spec/controllers/admin/settings_controller_spec.rb
@@ -5,10 +5,6 @@ require 'rails_helper'
 RSpec.describe Admin::SettingsController, type: :controller do
   render_views
 
-  before do
-    Rails.cache.clear
-  end
-
   describe 'When signed in as an admin' do
     before do
       sign_in Fabricate(:user, admin: true), scope: :user
@@ -24,12 +20,16 @@ RSpec.describe Admin::SettingsController, type: :controller do
 
     describe 'PUT #update' do
       describe 'for a record that doesnt exist' do
-        after do
+        around do |example|
+          before = Setting.site_extended_description
+          Setting.site_extended_description = nil
+          example.run
+          Setting.site_extended_description = before
           Setting.new_setting_key = nil
         end
 
         it 'cannot create a setting value for a non-admin key' do
-          expect(Setting.new_setting_key).to be_nil
+          expect(Setting.new_setting_key).to be_blank
 
           patch :update, params: { new_setting_key: 'New key value' }