Fix admin deletion by an administration

This commit is contained in:
simon lehericey 2019-08-19 10:47:37 +02:00
parent 6e83f3d524
commit ebe871819d
3 changed files with 16 additions and 2 deletions

View file

@ -31,4 +31,18 @@ describe Manager::AdministrateursController, type: :controller do
it { expect { subject }.to change(Administrateur, :count).by(0) }
end
end
describe '#delete' do
let!(:admin) { create(:administrateur) }
before { sign_in administration }
subject { delete :delete, params: { id: admin.id } }
it 'deletes the admin' do
subject
expect(Administrateur.find_by(id: admin.id)).to be_nil
end
end
end