empêche suppression d'un user qui est instructeur

This commit is contained in:
Christophe Robillard 2020-01-15 19:48:11 +01:00
parent a6d007dbd3
commit d9570eedc6
3 changed files with 10 additions and 2 deletions

View file

@ -234,6 +234,14 @@ describe User, type: :model do
end
end
context 'when the user is an instructeur' do
it 'cannot be deleted' do
instructeur = create(:instructeur)
user = instructeur.user
expect(user.can_be_deleted?).to be_falsy
end
end
end
describe '#delete_and_keep_track_dossiers' do