dossier: add a custom message for the dossier owner
This commit is contained in:
parent
7ba76c6658
commit
d4574bade1
3 changed files with 86 additions and 24 deletions
|
@ -0,0 +1,40 @@
|
|||
describe 'shared/dossiers/lost_attachments.html.haml', type: :view do
|
||||
let(:procedure) { create(:procedure, :published) }
|
||||
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
|
||||
|
||||
subject { render 'shared/dossiers/lost_attachments.html.haml', dossier: dossier, profile: profile }
|
||||
|
||||
context 'when viewed by an Usager' do
|
||||
let(:profile) { 'usager' }
|
||||
|
||||
it 'displays a warning message' do
|
||||
expect(subject).to include('Des pièces jointes de votre dossier peuvent être manquantes')
|
||||
expect(subject).to have_link('renvoyer les pièces jointes manquantes', href: modifier_dossier_path(dossier))
|
||||
end
|
||||
|
||||
context 'when the user can’t edit the dossier' do
|
||||
let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) }
|
||||
|
||||
it 'suggest to wait' do
|
||||
expect(subject).to include('l’administration vous contactera')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when viewed by an Instructeur' do
|
||||
let(:profile) { 'instructeur' }
|
||||
|
||||
it 'displays a warning message' do
|
||||
expect(subject).to include('Des pièces jointes de ce dossier peuvent être manquantes')
|
||||
expect(subject).to have_link('contacter le demandeur')
|
||||
end
|
||||
|
||||
context 'when the user can’t edit the dossier' do
|
||||
let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) }
|
||||
|
||||
it 'suggest to make the dossier editable again' do
|
||||
expect(subject).to include('repasser ce dossier en construction')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue