add AR in user view - hide decision on second dossier tab

This commit is contained in:
Lisa Durand 2024-03-26 14:50:49 +01:00
parent 8eda069bfc
commit e486f789f6
9 changed files with 65 additions and 25 deletions

View file

@ -59,4 +59,22 @@ describe 'users/dossiers/demande', type: :view do
expect(rendered).to have_text(dossier.individual.email.to_s)
end
end
context 'when a dossier is accepte with motivation' do
let(:dossier) { create(:dossier, :accepte, :with_motivation) }
it 'displays the motivation' do
expect(rendered).not_to have_text('Cette procédure est soumise à un accusé de lecture.')
expect(rendered).to have_text('Motivation')
end
end
context 'when a dossier is accepte with motivation and with accuse de lecture' do
let(:dossier) { create(:dossier, :accepte, :with_motivation, procedure: create(:procedure, :accuse_lecture)) }
it 'display information about accuse de lecture and not the motivation' do
expect(rendered).to have_text('Cette procédure est soumise à un accusé de lecture.')
expect(rendered).not_to have_text('Motivation')
end
end
end