Fix tests
This commit is contained in:
parent
306632f169
commit
0e6b5678ad
5 changed files with 4 additions and 10 deletions
|
@ -723,7 +723,7 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
let(:path) { procedure_owned.path }
|
let(:path) { procedure_owned.path }
|
||||||
|
|
||||||
it {
|
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
|
end
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
find('#publish-procedure').click
|
find('#publish-procedure').click
|
||||||
|
|
||||||
within '#publish-modal' do
|
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'
|
click_on 'publish'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,6 @@ module ProcedureSpecHelper
|
||||||
def fill_in_dummy_procedure_details(fill_path: true)
|
def fill_in_dummy_procedure_details(fill_path: true)
|
||||||
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
||||||
fill_in 'procedure_description', with: 'description 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_cadre_juridique', with: 'cadre juridique'
|
||||||
fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3'
|
fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3'
|
||||||
fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6'
|
fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6'
|
||||||
|
|
|
@ -26,21 +26,18 @@ feature 'Administrateurs can edit procedures', js: true do
|
||||||
administrateur: administrateur)
|
administrateur: administrateur)
|
||||||
end
|
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
|
visit admin_procedures_draft_path
|
||||||
click_on procedure.libelle
|
click_on procedure.libelle
|
||||||
click_on 'Description'
|
click_on 'Description'
|
||||||
|
|
||||||
expect(page).to have_field('procedure_libelle', with: procedure.libelle)
|
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_libelle', with: 'Ma petite démarche')
|
||||||
fill_in('procedure_path', with: 'nouveau-lien-demarche')
|
|
||||||
|
|
||||||
click_on 'Enregistrer'
|
click_on 'Enregistrer'
|
||||||
|
|
||||||
expect(page).to have_field('procedure_libelle', with: 'Ma petite démarche')
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ describe 'admin/procedures/show.html.haml', type: :view do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'procedure link is present' do
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue