From 1bdc737838172de4b7be1cc0f94ac446b21b978c Mon Sep 17 00:00:00 2001 From: Xavier J Date: Tue, 22 Sep 2015 13:15:58 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20des=20derniers=20tests=20suites=20?= =?UTF-8?q?au=20changement=20de=20sch=C3=A9ma=20de=20la=20BDD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/factories/procedure.rb | 4 +-- .../admin/dossier_page/show_page_spec.rb | 1 + .../description_page/show_page_spec.rb | 36 ++++++++----------- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb index 7a60ee69d..3b34c775a 100644 --- a/spec/factories/procedure.rb +++ b/spec/factories/procedure.rb @@ -7,10 +7,10 @@ FactoryGirl.define do trait :with_two_type_de_piece_justificative do after(:build) do |procedure, _evaluator| rib = create(:type_de_piece_justificative, :rib) - contrat = create(:type_de_piece_justificative, :contrat) + msa = create(:type_de_piece_justificative, :msa) procedure.types_de_piece_justificative << rib - procedure.types_de_piece_justificative << contrat + procedure.types_de_piece_justificative << msa end end end diff --git a/spec/features/admin/dossier_page/show_page_spec.rb b/spec/features/admin/dossier_page/show_page_spec.rb index 8fe2a3088..577a5f17c 100644 --- a/spec/features/admin/dossier_page/show_page_spec.rb +++ b/spec/features/admin/dossier_page/show_page_spec.rb @@ -33,6 +33,7 @@ feature 'Admin/Dossier#Show Page' do end end + #TODO réactiver # context 'la liste des pièces justificatives est présente' do # context 'Attestation MSA' do # let(:id_piece_justificative) { 93 } diff --git a/spec/features/description_page/show_page_spec.rb b/spec/features/description_page/show_page_spec.rb index d6ddd2b84..b72402987 100644 --- a/spec/features/description_page/show_page_spec.rb +++ b/spec/features/description_page/show_page_spec.rb @@ -126,25 +126,19 @@ feature 'Description#Show Page' do end end - # context 'Pièces justificatives' do - # context 'la liste des pièces justificatives a envoyé est affichée' do - # it 'Contrat' do - # expect(page).to have_selector('input[type=file][name=piece_justificative_764][id=piece_justificative_764]') - # end - # - # it 'RIB' do - # expect(page).to have_selector('input[type=file][name=piece_justificative_849][id=piece_justificative_849]') - # end - # end - # - # context 'la liste des pièces récupérées automatiquement est signaliée' do - # it 'Attestation MSA' do - # expect(page.find_by_id('piece_justificative_93')).to have_content('Nous l\'avons récupéré pour vous.') - # end - # - # it 'KBIS' do - # expect(page.find_by_id('piece_justificative_571')).to have_content('Nous l\'avons récupéré pour vous.') - # end - # end - # end + context 'Pièces justificatives' do + let(:all_type_pj_procedure_id) { dossier.procedure.type_de_piece_justificative_ids } + + context 'la liste des pièces justificatives a envoyé est affichée' do + it 'RIB' do + expect(page).to have_selector("input[type=file][name=piece_justificative_#{all_type_pj_procedure_id[0]}][id=piece_justificative_#{all_type_pj_procedure_id[0]}]") + end + end + + context 'la liste des pièces récupérées automatiquement est signaliée' do + it 'Attestation MSA' do + expect(page.find_by_id("piece_justificative_#{all_type_pj_procedure_id[1]}")).to have_content('Nous l\'avons récupéré pour vous.') + end + end + end end