fix specs

This commit is contained in:
Lisa Durand 2024-04-02 15:56:45 +02:00
parent 1cf3db5899
commit 18602e046a
2 changed files with 9 additions and 10 deletions

View file

@ -96,15 +96,6 @@ describe PiecesJustificativesService do
it { expect(subject).to be_empty } it { expect(subject).to be_empty }
end 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 context 'with an attestation' do
let(:dossier) { create(:dossier, :with_attestation) } let(:dossier) { create(:dossier, :with_attestation) }
let!(:witness) { create(:dossier, :with_attestation) } let!(:witness) { create(:dossier, :with_attestation) }

View file

@ -1,6 +1,6 @@
describe 'shared/dossiers/_infos_generales', type: :view do describe 'shared/dossiers/_infos_generales', type: :view do
let(:dossier) { create(:dossier, :en_construction) } let(:dossier) { create(:dossier, :en_construction) }
subject { render } subject { render 'shared/dossiers/infos_generales', dossier: dossier, profile: 'instructeur' }
before do before do
sign_in(current_role.user) sign_in(current_role.user)
allow(view).to receive(:current_instructeur).and_return(current_role) allow(view).to receive(:current_instructeur).and_return(current_role)
@ -32,6 +32,14 @@ describe 'shared/dossiers/_infos_generales', type: :view do
end end
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 context 'with an attestation' do
let(:dossier) { create :dossier, :accepte, :with_attestation } let(:dossier) { create :dossier, :accepte, :with_attestation }