Merge pull request #5127 from betagouv/5125-bug-depot-avis
Corrige l'erreur 404 sur les avis. Permet aux experts de consulter les bilans bdf
This commit is contained in:
commit
92efdafe44
4 changed files with 19 additions and 1 deletions
|
@ -72,6 +72,14 @@ module Instructeurs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bilans_bdf
|
||||||
|
if avis.dossier.etablissement&.entreprise_bilans_bdf_to_csv.present?
|
||||||
|
render csv: avis.dossier.etablissement.entreprise_bilans_bdf_to_csv
|
||||||
|
else
|
||||||
|
redirect_to instructeur_avis_path(avis)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def sign_up
|
def sign_up
|
||||||
@email = params[:email]
|
@email = params[:email]
|
||||||
@dossier = Avis.includes(:dossier).find(params[:id]).dossier
|
@dossier = Avis.includes(:dossier).find(params[:id]).dossier
|
||||||
|
|
|
@ -83,7 +83,10 @@
|
||||||
%th.libelle
|
%th.libelle
|
||||||
Bilans Banque de France
|
Bilans Banque de France
|
||||||
= "en #{etablissement.entreprise_bilans_bdf_monnaie}"
|
= "en #{etablissement.entreprise_bilans_bdf_monnaie}"
|
||||||
%td= link_to "Consulter les bilans", bilans_bdf_instructeur_dossier_path
|
- if controller.is_a?(Instructeurs::AvisController)
|
||||||
|
%td= link_to "Consulter les bilans", bilans_bdf_instructeur_avis_path(@avis.id)
|
||||||
|
- else
|
||||||
|
%td= link_to "Consulter les bilans", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id)
|
||||||
|
|
||||||
- if etablissement.association?
|
- if etablissement.association?
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -354,6 +354,7 @@ Rails.application.routes.draw do
|
||||||
get 'messagerie'
|
get 'messagerie'
|
||||||
post 'commentaire' => 'avis#create_commentaire'
|
post 'commentaire' => 'avis#create_commentaire'
|
||||||
post 'avis' => 'avis#create_avis'
|
post 'avis' => 'avis#create_avis'
|
||||||
|
get 'bilans_bdf'
|
||||||
|
|
||||||
get 'sign_up/email/:email' => 'avis#sign_up', constraints: { email: /.*/ }, as: 'sign_up'
|
get 'sign_up/email/:email' => 'avis#sign_up', constraints: { email: /.*/ }, as: 'sign_up'
|
||||||
post 'sign_up/email/:email' => 'avis#create_instructeur', constraints: { email: /.*/ }
|
post 'sign_up/email/:email' => 'avis#create_instructeur', constraints: { email: /.*/ }
|
||||||
|
|
|
@ -50,6 +50,12 @@ describe Instructeurs::AvisController, type: :controller do
|
||||||
it { expect(assigns(:dossier)).to eq(dossier) }
|
it { expect(assigns(:dossier)).to eq(dossier) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#bilans_bdf' do
|
||||||
|
before { get :bilans_bdf, params: { id: avis_without_answer.id } }
|
||||||
|
|
||||||
|
it { expect(response).to redirect_to(instructeur_avis_path(avis_without_answer)) }
|
||||||
|
end
|
||||||
|
|
||||||
describe '#update' do
|
describe '#update' do
|
||||||
describe 'without attachment' do
|
describe 'without attachment' do
|
||||||
before do
|
before do
|
||||||
|
|
Loading…
Reference in a new issue