From 8ae468e8c77cacec1377ada08522f9ef4e394b57 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Mon, 18 Feb 2019 17:59:09 +0100 Subject: [PATCH 1/2] ajout de la date de depot pour l'instructeur --- app/views/shared/dossiers/_demande.html.haml | 4 ++++ app/views/shared/dossiers/_horodatage.html.haml | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 app/views/shared/dossiers/_horodatage.html.haml diff --git a/app/views/shared/dossiers/_demande.html.haml b/app/views/shared/dossiers/_demande.html.haml index 3d9ba3de8..1ac304855 100644 --- a/app/views/shared/dossiers/_demande.html.haml +++ b/app/views/shared/dossiers/_demande.html.haml @@ -1,4 +1,8 @@ .container + - if dossier.en_construction_at.present? + .card + = render partial: "shared/dossiers/horodatage", locals: { dossier: dossier } + .tab-title Identité du demandeur .card = render partial: "shared/dossiers/user_infos", locals: { user: dossier.user } diff --git a/app/views/shared/dossiers/_horodatage.html.haml b/app/views/shared/dossiers/_horodatage.html.haml new file mode 100644 index 000000000..c97b9c601 --- /dev/null +++ b/app/views/shared/dossiers/_horodatage.html.haml @@ -0,0 +1,5 @@ +%table.table.vertical.dossier-champs + %tbody + %tr + %th.libelle Déposé le : + %td= l(dossier.en_construction_at, format: '%d %B %Y') From 4ff9adde27eaddaa62ccfc335032a9edb2817fc2 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Tue, 19 Feb 2019 11:41:20 +0100 Subject: [PATCH 2/2] =?UTF-8?q?ajout=20d'un=20test=20auto=20pour=20l'affic?= =?UTF-8?q?hage=20de=20la=20date=20de=20d=C3=A9pot=20cot=C3=A9=20instructe?= =?UTF-8?q?ur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/views/new_user/dossiers/demande.html.haml_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/views/new_user/dossiers/demande.html.haml_spec.rb b/spec/views/new_user/dossiers/demande.html.haml_spec.rb index 074c55d78..869128d92 100644 --- a/spec/views/new_user/dossiers/demande.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/demande.html.haml_spec.rb @@ -16,6 +16,7 @@ describe 'new_user/dossiers/demande.html.haml', type: :view do end it 'renders the dossier infos' do + expect(rendered).to have_text('Déposé le') expect(rendered).to have_text('Identité') expect(rendered).to have_text('Demande') expect(rendered).to have_text('Pièces jointes') @@ -29,4 +30,10 @@ describe 'new_user/dossiers/demande.html.haml', type: :view do let(:dossier) { create(:dossier, :en_instruction, :with_entreprise, procedure: procedure) } it { is_expected.not_to have_link('Modifier le dossier') } end + + context 'when the dossier has no en_construction_at date' do + let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure) } + + it { expect(rendered).not_to have_text('Déposé le') } + end end