From a84269e66e5be558ac3c577b624bc911d70f8c70 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 29 Nov 2022 14:16:27 +0100 Subject: [PATCH] fix(avis_controller): revoked acl on bilans_pdf --- app/controllers/experts/avis_controller.rb | 2 +- spec/controllers/experts/avis_controller_spec.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/experts/avis_controller.rb b/app/controllers/experts/avis_controller.rb index 61190c40e..034cc99cb 100644 --- a/app/controllers/experts/avis_controller.rb +++ b/app/controllers/experts/avis_controller.rb @@ -4,7 +4,7 @@ module Experts include Zipline before_action :authenticate_expert!, except: [:sign_up, :update_expert] - before_action :check_if_avis_revoked, only: [:show, :instruction, :create_avis, :update, :sign_up, :update_expert, :messagerie, :create_commentaire] + before_action :check_if_avis_revoked, only: [:show, :instruction, :create_avis, :update, :sign_up, :update_expert, :messagerie, :create_commentaire, :bilans_bdf] before_action :redirect_if_no_sign_up_needed, only: [:sign_up, :update_expert] before_action :set_avis_and_dossier, only: [:show, :instruction, :messagerie, :create_commentaire, :delete_commentaire, :update, :telecharger_pjs] diff --git a/spec/controllers/experts/avis_controller_spec.rb b/spec/controllers/experts/avis_controller_spec.rb index f3805e27d..cb18063d6 100644 --- a/spec/controllers/experts/avis_controller_spec.rb +++ b/spec/controllers/experts/avis_controller_spec.rb @@ -78,9 +78,17 @@ describe Experts::AvisController, type: :controller do end describe '#bilans_bdf' do - before { get :bilans_bdf, params: { id: avis_without_answer.id, procedure_id: } } + let(:avis) { avis_without_answer } + + before { get :bilans_bdf, params: { id: avis, procedure_id: } } it { expect(response).to redirect_to(instructeur_avis_path(avis_without_answer)) } + + context 'with a revoked avis' do + let(:avis) { revoked_avis } + + it { expect(response).to redirect_to(root_path) } + end end describe '#show' do