Fix account delete form not accepting password, update suspended (#3745)

account before removing content for quicker feedback to end-users
master
Eugen Rochko 8 years ago committed by GitHub
parent 98eacb2238
commit 91c71471ab
  1. 2
      app/controllers/settings/deletes_controller.rb
  2. 2
      app/services/suspend_account_service.rb
  3. 4
      spec/controllers/settings/deletes_controller_spec.rb

@ -22,6 +22,6 @@ class Settings::DeletesController < ApplicationController
private private
def delete_params def delete_params
params.permit(:password) params.require(:form_delete_confirmation).permit(:password)
end end
end end

@ -5,8 +5,8 @@ class SuspendAccountService < BaseService
@account = account @account = account
purge_user if remove_user purge_user if remove_user
purge_content
purge_profile purge_profile
purge_content
unsubscribe_push_subscribers unsubscribe_push_subscribers
end end

@ -35,7 +35,7 @@ describe Settings::DeletesController do
context 'with correct password' do context 'with correct password' do
before do before do
delete :destroy, params: { password: 'petsmoldoggos' } delete :destroy, params: { form_delete_confirmation: { password: 'petsmoldoggos' } }
end end
it 'redirects to sign in page' do it 'redirects to sign in page' do
@ -53,7 +53,7 @@ describe Settings::DeletesController do
context 'with incorrect password' do context 'with incorrect password' do
before do before do
delete :destroy, params: { password: 'blaze420' } delete :destroy, params: { form_delete_confirmation: { password: 'blaze420' } }
end end
it 'redirects back to confirmation page' do it 'redirects back to confirmation page' do

Loading…
Cancel
Save