From 18602e046a70988136bdbbaa68e367dc3ddc48e6 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Tue, 2 Apr 2024 15:56:45 +0200 Subject: [PATCH] fix specs --- spec/services/pieces_justificatives_service_spec.rb | 9 --------- .../shared/dossiers/_infos_generales.html.haml_spec.rb | 10 +++++++++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spec/services/pieces_justificatives_service_spec.rb b/spec/services/pieces_justificatives_service_spec.rb index 6c4c4cd0e..eaf7a919d 100644 --- a/spec/services/pieces_justificatives_service_spec.rb +++ b/spec/services/pieces_justificatives_service_spec.rb @@ -96,15 +96,6 @@ describe PiecesJustificativesService do it { expect(subject).to be_empty } end - context 'with a motivation and procedure with accuse de lecture' do - let(:dossier) { create :dossier, :accepte, :with_motivation, procedure: create(:procedure, :accuse_lecture) } - - it 'still displays the motivation text for the instructeur and the correct dossier state' do - expect(subject).to have_content(dossier.motivation) - expect(rendered).to have_selector('.fr-badge', text: 'accepté', count: 1) - end - end - context 'with an attestation' do let(:dossier) { create(:dossier, :with_attestation) } let!(:witness) { create(:dossier, :with_attestation) } diff --git a/spec/views/shared/dossiers/_infos_generales.html.haml_spec.rb b/spec/views/shared/dossiers/_infos_generales.html.haml_spec.rb index 627f637b3..2e82c0423 100644 --- a/spec/views/shared/dossiers/_infos_generales.html.haml_spec.rb +++ b/spec/views/shared/dossiers/_infos_generales.html.haml_spec.rb @@ -1,6 +1,6 @@ describe 'shared/dossiers/_infos_generales', type: :view do let(:dossier) { create(:dossier, :en_construction) } - subject { render } + subject { render 'shared/dossiers/infos_generales', dossier: dossier, profile: 'instructeur' } before do sign_in(current_role.user) allow(view).to receive(:current_instructeur).and_return(current_role) @@ -32,6 +32,14 @@ describe 'shared/dossiers/_infos_generales', type: :view do end end + context 'with a motivation and procedure with accuse de lecture' do + let(:dossier) { create :dossier, :accepte, :with_justificatif, procedure: create(:procedure, :accuse_lecture) } + + it 'still displays the motivation text for the instructeur' do + expect(subject).to have_content(dossier.motivation) + end + end + context 'with an attestation' do let(:dossier) { create :dossier, :accepte, :with_attestation }