Add notice when merging account
This commit is contained in:
parent
a480b31eb5
commit
5009c583ea
2 changed files with 3 additions and 0 deletions
|
@ -28,6 +28,8 @@ module Manager
|
||||||
else
|
else
|
||||||
preexisting_user.expert.merge(user.expert)
|
preexisting_user.expert.merge(user.expert)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
flash[:notice] = "Le compte « #{targeted_email} » a absorbé le compte « #{user.email} »."
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to edit_manager_user_path(user)
|
redirect_to edit_manager_user_path(user)
|
||||||
|
|
|
@ -68,6 +68,7 @@ describe Manager::UsersController, type: :controller do
|
||||||
|
|
||||||
expect(preexisting_user.instructeur).to match(instructeur)
|
expect(preexisting_user.instructeur).to match(instructeur)
|
||||||
expect(preexisting_user.expert).to match(expert)
|
expect(preexisting_user.expert).to match(expert)
|
||||||
|
expect(flash[:notice]).to match("Le compte « email.existant@domaine.fr » a absorbé le compte « ancien.email@domaine.fr ».")
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'and the preexisting account owns an instructeur and expert as well' do
|
context 'and the preexisting account owns an instructeur and expert as well' do
|
||||||
|
|
Loading…
Reference in a new issue