Merge pull request #6692 from betagouv/fix_redirection_in_manager

Dans le manager, redirige correctement sur après avoir mergé des utilisateurs
This commit is contained in:
LeSim 2021-11-29 15:31:02 +01:00 committed by GitHub
commit 5736521f52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -13,13 +13,14 @@ module Manager
else
flash[:error] = user.errors.full_messages.to_sentence
end
redirect_to edit_manager_user_path(user)
else
targeted_user.merge(user)
flash[:notice] = "Le compte « #{targeted_email} » a absorbé le compte « #{user.email} »."
redirect_to edit_manager_user_path(targeted_user)
end
redirect_to edit_manager_user_path(user)
end
def resend_confirmation_instructions

View file

@ -29,6 +29,7 @@ describe Manager::UsersController, type: :controller do
subject
expect(User.find_by(id: user.id).email).to eq(nouvel_email)
expect(response).to redirect_to(edit_manager_user_path(user))
end
end
@ -54,6 +55,7 @@ describe Manager::UsersController, type: :controller do
subject
expect(flash[:notice]).to match("Le compte « email.existant@domaine.fr » a absorbé le compte « ancien.email@domaine.fr ».")
expect(response).to redirect_to(edit_manager_user_path(targeted_user))
end
end
end