refactor
This commit is contained in:
parent
32d1ebe565
commit
ba3d2f1b9f
1 changed files with 4 additions and 10 deletions
|
@ -1,12 +1,12 @@
|
|||
describe Manager::AdministrateursController, type: :controller do
|
||||
let(:administration) { create(:administration) }
|
||||
|
||||
before do
|
||||
sign_in administration
|
||||
end
|
||||
|
||||
describe 'GET #new' do
|
||||
render_views
|
||||
before do
|
||||
sign_in administration
|
||||
end
|
||||
|
||||
it 'displays form to create a new admin' do
|
||||
get :new
|
||||
expect(response).to be_success
|
||||
|
@ -17,10 +17,6 @@ describe Manager::AdministrateursController, type: :controller do
|
|||
let(:email) { 'plop@plop.com' }
|
||||
let(:password) { 'démarches-simplifiées-pwd' }
|
||||
|
||||
before do
|
||||
sign_in administration
|
||||
end
|
||||
|
||||
subject { post :create, params: { administrateur: { email: email } } }
|
||||
|
||||
context 'when email and password are correct' do
|
||||
|
@ -47,8 +43,6 @@ describe Manager::AdministrateursController, type: :controller do
|
|||
describe '#delete' do
|
||||
let!(:admin) { create(:administrateur) }
|
||||
|
||||
before { sign_in administration }
|
||||
|
||||
subject { delete :delete, params: { id: admin.id } }
|
||||
|
||||
it 'deletes the admin' do
|
||||
|
|
Loading…
Add table
Reference in a new issue