From ba671534c313a7c129a7fb5ce2f168d0a68c58a0 Mon Sep 17 00:00:00 2001 From: Tanguy PATTE Date: Thu, 24 Sep 2015 12:02:59 +0200 Subject: [PATCH] [#890] add link to dossier in list dossier --- app/views/users/dossiers/index.html.haml | 3 ++- spec/features/users/list_dossiers_spec.rb | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 30f4a7fb4..6046f6223 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -6,5 +6,6 @@ %th Mise à jour - @dossiers.each do |dossier| %tr - %td= dossier.nom_projet + %td + = link_to(dossier.nom_projet, users_dossier_recapitulatif_path(dossier)) %td= dossier.last_update \ No newline at end of file diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index bd754e769..236ef4188 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'user access to the list of his dossier' do let(:user) { create(:user) } - let!(:dossier1) { create(:dossier, user: user, nom_projet: 'mon permier dossier') } + let!(:dossier1) { create(:dossier, :with_procedure, user: user, nom_projet: 'mon permier dossier') } let!(:dossier2) { create(:dossier, :with_user, nom_projet: 'mon deuxième dossier') } before do visit root_path @@ -15,4 +15,12 @@ feature 'user access to the list of his dossier' do expect(page).to have_content(dossier1.nom_projet) expect(page).not_to have_content(dossier2.nom_projet) end + context 'when user clicks on a projet in list' do + before do + page.click_on dossier1.nom_projet + end + scenario 'user is redirected to dossier page' do + expect(page).to have_css('#recap_dossier') + end + end end \ No newline at end of file