fix(avis_controller): revoked acl on bilans_pdf
This commit is contained in:
parent
d764959659
commit
a84269e66e
2 changed files with 10 additions and 2 deletions
|
@ -4,7 +4,7 @@ module Experts
|
||||||
include Zipline
|
include Zipline
|
||||||
|
|
||||||
before_action :authenticate_expert!, except: [:sign_up, :update_expert]
|
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 :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]
|
before_action :set_avis_and_dossier, only: [:show, :instruction, :messagerie, :create_commentaire, :delete_commentaire, :update, :telecharger_pjs]
|
||||||
|
|
||||||
|
|
|
@ -78,9 +78,17 @@ describe Experts::AvisController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#bilans_bdf' do
|
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)) }
|
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
|
end
|
||||||
|
|
||||||
describe '#show' do
|
describe '#show' do
|
||||||
|
|
Loading…
Reference in a new issue