Redirect user to sign up path after deletion (#12696)
This commit is contained in:
parent
544030ff2c
commit
3f02045458
2 changed files with 3 additions and 3 deletions
|
|
@ -122,7 +122,7 @@ class UsersController < ApplicationController
|
|||
Users::DeleteWorker.perform_async(@user.id)
|
||||
sign_out @user
|
||||
flash[:global_notice] = "Your account deletion is scheduled. You'll be notified when it's deleted."
|
||||
redirect_to root_path
|
||||
redirect_to new_user_registration_path
|
||||
else
|
||||
flash[:settings_notice] = "Please, provide an email to delete your account"
|
||||
redirect_to user_settings_path("account")
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ RSpec.describe "UserDestroy", type: :request do
|
|||
expect(controller.current_user).to eq nil
|
||||
end
|
||||
|
||||
it "redirects to root" do
|
||||
it "redirects to sign up" do
|
||||
delete "/users/full_delete"
|
||||
expect(response).to redirect_to "/"
|
||||
expect(response).to redirect_to new_user_registration_path
|
||||
expect(flash[:global_notice]).to include("Your account deletion is scheduled")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue