From 0e6b5678adfe9da10bc50774e6f8fd56c0543779 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 16 Jan 2019 17:23:33 +0100 Subject: [PATCH] Fix tests --- spec/controllers/admin/procedures_controller_spec.rb | 2 +- spec/features/admin/procedure_creation_spec.rb | 2 +- spec/features/admin/procedure_spec_helper.rb | 3 --- spec/features/admin/procedure_update_spec.rb | 5 +---- spec/views/admin/procedures/show.html.haml_spec.rb | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/spec/controllers/admin/procedures_controller_spec.rb b/spec/controllers/admin/procedures_controller_spec.rb index 3c114208f..bad0c5be6 100644 --- a/spec/controllers/admin/procedures_controller_spec.rb +++ b/spec/controllers/admin/procedures_controller_spec.rb @@ -723,7 +723,7 @@ describe Admin::ProceduresController, type: :controller do let(:path) { procedure_owned.path } it { - expect(response.body).to include('Un brouillon de démarche existe déjà avec ce lien.') + expect(response.body).to include('Une démarche en test existe déjà avec ce lien.') } end diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb index 2b3047510..646382773 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/features/admin/procedure_creation_spec.rb @@ -150,7 +150,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do find('#publish-procedure').click within '#publish-modal' do - expect(page).to have_field('procedure_path', with: 'lien-de-la-procedure') + expect(page).to have_field('procedure_path') click_on 'publish' end diff --git a/spec/features/admin/procedure_spec_helper.rb b/spec/features/admin/procedure_spec_helper.rb index 0154e9609..b9708d3a4 100644 --- a/spec/features/admin/procedure_spec_helper.rb +++ b/spec/features/admin/procedure_spec_helper.rb @@ -2,9 +2,6 @@ module ProcedureSpecHelper def fill_in_dummy_procedure_details(fill_path: true) fill_in 'procedure_libelle', with: 'libelle de la procedure' fill_in 'procedure_description', with: 'description de la procedure' - if fill_path - fill_in 'procedure_path', with: 'lien-de-la-procedure' - end fill_in 'procedure_cadre_juridique', with: 'cadre juridique' fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3' fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6' diff --git a/spec/features/admin/procedure_update_spec.rb b/spec/features/admin/procedure_update_spec.rb index 68f9b3df4..b80714274 100644 --- a/spec/features/admin/procedure_update_spec.rb +++ b/spec/features/admin/procedure_update_spec.rb @@ -26,21 +26,18 @@ feature 'Administrateurs can edit procedures', js: true do administrateur: administrateur) end - scenario 'the administrator can edit the libelle and the path' do + scenario 'the administrator can edit the libelle' do visit admin_procedures_draft_path click_on procedure.libelle click_on 'Description' expect(page).to have_field('procedure_libelle', with: procedure.libelle) - expect(page).to have_field('procedure_path', with: procedure.path) fill_in('procedure_libelle', with: 'Ma petite démarche') - fill_in('procedure_path', with: 'nouveau-lien-demarche') click_on 'Enregistrer' expect(page).to have_field('procedure_libelle', with: 'Ma petite démarche') - expect(page).to have_field('procedure_path', with: 'nouveau-lien-demarche') end end diff --git a/spec/views/admin/procedures/show.html.haml_spec.rb b/spec/views/admin/procedures/show.html.haml_spec.rb index ea89b49b4..d645c0881 100644 --- a/spec/views/admin/procedures/show.html.haml_spec.rb +++ b/spec/views/admin/procedures/show.html.haml_spec.rb @@ -72,7 +72,7 @@ describe 'admin/procedures/show.html.haml', type: :view do end describe 'procedure link is present' do - it { expect(rendered).to have_content('Cette démarche est archivée et n’est donc pas accessible par le public.') } + it { expect(rendered).to have_content('Cette démarche est archivée et n’est donc plus accessible par le public.') } end end end