diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-09-11 20:56:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 20:56:35 +0200 |
commit | 4e4b3a0c8e69a724e229f028896ce774ef26df3b (patch) | |
tree | d5e7e22746d286998972b138dafa260a2482e532 /spec | |
parent | e6b272e5c9c227cfbbe375a893f567c5967d669c (diff) |
Refactor settings controllers (#14767)
- Disallow suspended accounts from revoking sessions and apps - Allow suspended accounts to access exports
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/settings/deletes_controller_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/controllers/settings/deletes_controller_spec.rb b/spec/controllers/settings/deletes_controller_spec.rb index 996872efd..8d5c4774f 100644 --- a/spec/controllers/settings/deletes_controller_spec.rb +++ b/spec/controllers/settings/deletes_controller_spec.rb @@ -77,26 +77,26 @@ describe Settings::DeletesController do expect(response).to redirect_to settings_delete_path end end - end - context 'when not signed in' do - it 'redirects' do - delete :destroy - expect(response).to redirect_to '/auth/sign_in' - end - end + context 'when account deletions are disabled' do + around do |example| + open_deletion = Setting.open_deletion + example.run + Setting.open_deletion = open_deletion + end - context do - around do |example| - open_deletion = Setting.open_deletion - example.run - Setting.open_deletion = open_deletion + it 'redirects' do + Setting.open_deletion = false + delete :destroy + expect(response).to redirect_to root_path + end end + end + context 'when not signed in' do it 'redirects' do - Setting.open_deletion = false delete :destroy - expect(response).to redirect_to root_path + expect(response).to redirect_to '/auth/sign_in' end end end |