2020-01-30 10:48:28 +01:00
|
|
|
describe Manager::InstructeursController, type: :controller do
|
2020-11-05 15:09:11 +01:00
|
|
|
let(:super_admin) { create(:super_admin) }
|
2020-03-26 16:17:07 +01:00
|
|
|
let(:instructeur) { create(:instructeur) }
|
2020-01-30 10:48:28 +01:00
|
|
|
|
2020-03-26 16:17:07 +01:00
|
|
|
describe '#show' do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
before do
|
2020-11-05 15:09:11 +01:00
|
|
|
sign_in(super_admin)
|
2020-03-26 16:17:07 +01:00
|
|
|
get :show, params: { id: instructeur.id }
|
|
|
|
end
|
2020-01-30 10:48:28 +01:00
|
|
|
|
2020-03-26 16:17:07 +01:00
|
|
|
it { expect(response.body).to include(instructeur.email) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#delete' do
|
2020-11-05 15:09:11 +01:00
|
|
|
before { sign_in super_admin }
|
2020-01-30 10:48:28 +01:00
|
|
|
|
|
|
|
subject { delete :delete, params: { id: instructeur.id } }
|
|
|
|
|
|
|
|
it 'deletes the instructeur' do
|
|
|
|
subject
|
|
|
|
|
|
|
|
expect(Instructeur.find_by(id: instructeur.id)).to be_nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|