diff --git a/app/views/new_gestionnaire/dossiers/print.html.haml b/app/views/new_gestionnaire/dossiers/print.html.haml index 69fab09cc..dbffd5ec5 100644 --- a/app/views/new_gestionnaire/dossiers/print.html.haml +++ b/app/views/new_gestionnaire/dossiers/print.html.haml @@ -84,7 +84,7 @@ %ul.messages-list - @dossier.commentaires.each do |commentaire| %li - = render partial: "new_gestionnaire/shared/messages/message", locals: { commentaire: commentaire, user_email: current_gestionnaire.email, messagerie_seen_at: nil } + = render partial: "shared/dossiers/messages/message", locals: { commentaire: commentaire, user_email: current_gestionnaire.email, messagerie_seen_at: nil } %script{ type: "text/javascript" } window.print(); diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index 9cb453142..cb159e899 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -64,6 +64,12 @@ FactoryBot.define do end end + trait :with_commentaires do + after(:create) do |dossier, _evaluator| + dossier.commentaires += create_list(:commentaire, 2) + end + end + trait :followed do after(:create) do |dossier, _evaluator| g = create(:gestionnaire) diff --git a/spec/views/new_gestionnaire/dossiers/print.html.haml_spec.rb b/spec/views/new_gestionnaire/dossiers/print.html.haml_spec.rb index 02b6e755d..1aaf41029 100644 --- a/spec/views/new_gestionnaire/dossiers/print.html.haml_spec.rb +++ b/spec/views/new_gestionnaire/dossiers/print.html.haml_spec.rb @@ -3,7 +3,7 @@ describe 'new_gestionnaire/dossiers/print.html.haml', type: :view do context "with a dossier" do let(:current_gestionnaire) { create(:gestionnaire) } - let(:dossier) { create(:dossier, :en_instruction) } + let(:dossier) { create(:dossier, :en_instruction, :with_commentaires) } before do assign(:dossier, dossier)