about summary refs log tree commit diff
path: root/spec/controllers/settings
diff options
context:
space:
mode:
authormasarakki <masaki182@gmail.com>2017-06-19 22:12:31 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-19 15:12:31 +0200
commitff142eb64d2d1251f9df1baa0b302fd532ec30ed (patch)
tree66c9e30ddef330ae32d3b0adb75983bf38bc0a4b /spec/controllers/settings
parent500e28442f8e6657de766fbdb4a4cfdb164b2b92 (diff)
setting-for-account-deletable (#3852)
Diffstat (limited to 'spec/controllers/settings')
-rw-r--r--spec/controllers/settings/deletes_controller_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/settings/deletes_controller_spec.rb b/spec/controllers/settings/deletes_controller_spec.rb
index b9c7c3068..9b55090df 100644
--- a/spec/controllers/settings/deletes_controller_spec.rb
+++ b/spec/controllers/settings/deletes_controller_spec.rb
@@ -68,5 +68,19 @@ describe Settings::DeletesController do
         expect(response).to redirect_to '/auth/sign_in'
       end
     end
+
+    context do
+      around do |example|
+        open_deletion = Setting.open_deletion
+        example.run
+        Setting.open_deletion = open_deletion
+      end
+
+      it 'redirects' do
+        Setting.open_deletion = false
+        delete :destroy
+        expect(response).to redirect_to root_path
+      end
+    end
   end
 end