Redirect user to sign up path after deletion (#12696)

This commit is contained in:
Alex 2021-02-16 12:15:36 -05:00 committed by GitHub
parent 544030ff2c
commit 3f02045458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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")

View file

@ -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