From 1d86f863d35310c38f2eb29b37a87f7cf97587ad Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Fri, 26 Jun 2020 20:02:01 +0200 Subject: [PATCH] rename avis#all to avis#index --- app/controllers/instructeurs/avis_controller.rb | 2 +- .../instructeurs/avis/{all.html.haml => index.html.haml} | 0 config/routes.rb | 2 +- spec/controllers/instructeurs/avis_controller_spec.rb | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/views/instructeurs/avis/{all.html.haml => index.html.haml} (100%) diff --git a/app/controllers/instructeurs/avis_controller.rb b/app/controllers/instructeurs/avis_controller.rb index 600bc983b..6382da31d 100644 --- a/app/controllers/instructeurs/avis_controller.rb +++ b/app/controllers/instructeurs/avis_controller.rb @@ -10,7 +10,7 @@ module Instructeurs A_DONNER_STATUS = 'a-donner' DONNES_STATUS = 'donnes' - def all + def index avis = current_instructeur.avis.includes(dossier: [groupe_instructeur: :procedure]) @avis_by_procedure = avis.to_a.group_by(&:procedure) end diff --git a/app/views/instructeurs/avis/all.html.haml b/app/views/instructeurs/avis/index.html.haml similarity index 100% rename from app/views/instructeurs/avis/all.html.haml rename to app/views/instructeurs/avis/index.html.haml diff --git a/config/routes.rb b/config/routes.rb index 3fe255442..67801ac80 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -300,7 +300,7 @@ Rails.application.routes.draw do # scope module: 'instructeurs', as: 'instructeur' do - get 'avis', to: 'avis#all', as: 'all_avis' + get 'avis', to: 'avis#index', as: 'all_avis' # this redirections are ephemeral, to ensure that emails sent to experts before are still valid # TODO : they will be removed in September, 2020 diff --git a/spec/controllers/instructeurs/avis_controller_spec.rb b/spec/controllers/instructeurs/avis_controller_spec.rb index 22687c059..811bc060e 100644 --- a/spec/controllers/instructeurs/avis_controller_spec.rb +++ b/spec/controllers/instructeurs/avis_controller_spec.rb @@ -12,8 +12,8 @@ describe Instructeurs::AvisController, type: :controller do before { sign_in(instructeur.user) } - describe '#all' do - before { get :all } + describe '#index' do + before { get :index } it { expect(response).to have_http_status(:success) } it { expect(assigns(:avis_by_procedure).flatten).to include(procedure) }