diff --git a/spec/controllers/admin/gestionnaires_controller_spec.rb b/spec/controllers/admin/gestionnaires_controller_spec.rb index 1e2c701f9..2398c08cb 100644 --- a/spec/controllers/admin/gestionnaires_controller_spec.rb +++ b/spec/controllers/admin/gestionnaires_controller_spec.rb @@ -16,10 +16,11 @@ describe Admin::GestionnairesController, type: :controller do describe 'GET #index with sorting and pagination' do subject { - get :index, + get :index, params: { 'gestionnaires_smart_listing[page]': 1, 'gestionnaires_smart_listing[per_page]': 10, 'gestionnaires_smart_listing[sort][email]': 'asc' + } } it { expect(subject.status).to eq(200) } diff --git a/spec/controllers/admin/procedures_controller_spec.rb b/spec/controllers/admin/procedures_controller_spec.rb index 2ea08fd37..0931d12d9 100644 --- a/spec/controllers/admin/procedures_controller_spec.rb +++ b/spec/controllers/admin/procedures_controller_spec.rb @@ -44,10 +44,11 @@ describe Admin::ProceduresController, type: :controller do describe 'GET #index with sorting and pagination' do subject { - get :index, + get :index, params: { 'procedures_smart_listing[page]': 1, 'procedures_smart_listing[per_page]': 10, 'procedures_smart_listing[sort][id]': 'asc' + } } it { expect(subject.status).to eq(200) } @@ -61,10 +62,11 @@ describe Admin::ProceduresController, type: :controller do describe 'GET #archived with sorting and pagination' do subject { - get :archived, + get :archived, params: { 'procedures_smart_listing[page]': 1, 'procedures_smart_listing[per_page]': 10, 'procedures_smart_listing[sort][libelle]': 'asc' + } } it { expect(subject.status).to eq(200) } @@ -78,10 +80,11 @@ describe Admin::ProceduresController, type: :controller do describe 'GET #draft with sorting and pagination' do subject { - get :draft, + get :draft, params: { 'procedures_smart_listing[page]': 1, 'procedures_smart_listing[per_page]': 10, 'procedures_smart_listing[sort][published_at]': 'asc' + } } it { expect(subject.status).to eq(200) } diff --git a/spec/controllers/manager/administrateurs_controller_spec.rb b/spec/controllers/manager/administrateurs_controller_spec.rb index 9a7d58fcd..86fbe4ea5 100644 --- a/spec/controllers/manager/administrateurs_controller_spec.rb +++ b/spec/controllers/manager/administrateurs_controller_spec.rb @@ -9,7 +9,7 @@ describe Manager::AdministrateursController, type: :controller do sign_in administration end - subject { post :create, administrateur: { email: email } } + subject { post :create, params: { administrateur: { email: email } } } context 'when email and password are correct' do it 'add new administrateur in database' do diff --git a/spec/controllers/manager/procedures_controller_spec.rb b/spec/controllers/manager/procedures_controller_spec.rb index 69b133439..e4cd1ec45 100644 --- a/spec/controllers/manager/procedures_controller_spec.rb +++ b/spec/controllers/manager/procedures_controller_spec.rb @@ -5,7 +5,7 @@ describe Manager::ProceduresController, type: :controller do before do sign_in administration - post :whitelist, id: procedure.id + post :whitelist, params: { id: procedure.id } procedure.reload end diff --git a/spec/controllers/new_gestionnaire/avis_controller_spec.rb b/spec/controllers/new_gestionnaire/avis_controller_spec.rb index 094d384ba..a7a94700e 100644 --- a/spec/controllers/new_gestionnaire/avis_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/avis_controller_spec.rb @@ -22,14 +22,14 @@ describe NewGestionnaire::AvisController, type: :controller do it { expect(assigns(:statut)).to eq('a-donner') } context 'with a statut equal to donnes' do - before { get :index, statut: 'donnes' } + before { get :index, params: { statut: 'donnes' } } it { expect(assigns(:statut)).to eq('donnes') } end end describe '#show' do - before { get :show, { id: avis_without_answer.id } } + before { get :show, params: { id: avis_without_answer.id } } it { expect(response).to have_http_status(:success) } it { expect(assigns(:avis)).to eq(avis_without_answer) } @@ -37,7 +37,7 @@ describe NewGestionnaire::AvisController, type: :controller do end describe '#instruction' do - before { get :instruction, { id: avis_without_answer.id } } + before { get :instruction, params: { id: avis_without_answer.id } } it { expect(response).to have_http_status(:success) } it { expect(assigns(:avis)).to eq(avis_without_answer) } @@ -45,7 +45,7 @@ describe NewGestionnaire::AvisController, type: :controller do end describe '#messagerie' do - before { get :messagerie, { id: avis_without_answer.id } } + before { get :messagerie, params: { id: avis_without_answer.id } } it { expect(response).to have_http_status(:success) } it { expect(assigns(:avis)).to eq(avis_without_answer) } @@ -54,7 +54,7 @@ describe NewGestionnaire::AvisController, type: :controller do describe '#update' do before do - patch :update, { id: avis_without_answer.id, avis: { answer: 'answer' } } + patch :update, params: { id: avis_without_answer.id, avis: { answer: 'answer' } } avis_without_answer.reload end @@ -67,7 +67,7 @@ describe NewGestionnaire::AvisController, type: :controller do let(:file) { nil } let(:scan_result) { true } - subject { post :create_commentaire, { id: avis_without_answer.id, commentaire: { body: 'commentaire body', file: file } } } + subject { post :create_commentaire, params: { id: avis_without_answer.id, commentaire: { body: 'commentaire body', file: file } } } before do allow(ClamavService).to receive(:safe_file?).and_return(scan_result) @@ -105,7 +105,7 @@ describe NewGestionnaire::AvisController, type: :controller do let(:created_avis) { Avis.last } before do - post :create_avis, { id: previous_avis.id, avis: { email: email, introduction: intro, confidentiel: asked_confidentiel } } + post :create_avis, params: { id: previous_avis.id, avis: { email: email, introduction: intro, confidentiel: asked_confidentiel } } end context 'when the previous avis is public' do