From c56199e8f746a2c708f5d86bf24a5d55282263cd Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 4 Oct 2021 13:10:14 +0200 Subject: [PATCH] spec cleaning --- spec/controllers/manager/users_controller_spec.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spec/controllers/manager/users_controller_spec.rb b/spec/controllers/manager/users_controller_spec.rb index 3593a9dcc..2e7ea86ce 100644 --- a/spec/controllers/manager/users_controller_spec.rb +++ b/spec/controllers/manager/users_controller_spec.rb @@ -1,6 +1,8 @@ describe Manager::UsersController, type: :controller do let(:super_admin) { create(:super_admin) } + before { sign_in super_admin } + describe '#show' do render_views @@ -8,7 +10,6 @@ describe Manager::UsersController, type: :controller do let(:user) { create(:user) } before do - sign_in(super_admin) get :show, params: { id: user.id } end @@ -16,11 +17,8 @@ describe Manager::UsersController, type: :controller do end describe '#update' do - let!(:user) { create(:user, email: 'ancien.email@domaine.fr') } + let(:user) { create(:user, email: 'ancien.email@domaine.fr') } - before { - sign_in super_admin - } subject { patch :update, params: { id: user.id, user: { email: nouvel_email } } } describe 'with a valid email' do @@ -46,9 +44,7 @@ describe Manager::UsersController, type: :controller do end describe '#delete' do - let!(:user) { create(:user) } - - before { sign_in super_admin } + let(:user) { create(:user) } subject { delete :delete, params: { id: user.id } }