From 93e068421bee8af4caa4cfbedcad8d7a5caf10c8 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Wed, 9 May 2018 16:16:09 +0200 Subject: [PATCH] [#1833] New procedure button defaults to procedure library --- app/views/admin/procedures/index.html.haml | 2 +- spec/features/admin/procedure_cloning_spec.rb | 1 + spec/features/admin/procedure_creation_spec.rb | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/admin/procedures/index.html.haml b/app/views/admin/procedures/index.html.haml index 89ed60b86..540c498fc 100644 --- a/app/views/admin/procedures/index.html.haml +++ b/app/views/admin/procedures/index.html.haml @@ -6,7 +6,7 @@ .carret-right .carret-down Procédures - %a{ href: '/admin/procedures/new' } + %a{ href: new_from_existing_admin_procedures_path } #new-procedure.col-lg-2.col-md-2.col-sm-2.col-xs-2.action Nouvelle diff --git a/spec/features/admin/procedure_cloning_spec.rb b/spec/features/admin/procedure_cloning_spec.rb index 8d8020641..149bf0242 100644 --- a/spec/features/admin/procedure_cloning_spec.rb +++ b/spec/features/admin/procedure_cloning_spec.rb @@ -11,6 +11,7 @@ feature 'As an administrateur I wanna clone a procedure', js: true do context 'Cloning procedure' do before 'Create procedure' do page.find_by_id('new-procedure').click + page.find_by_id('from-scratch').click fill_in 'procedure_libelle', with: 'libelle de la procedure' page.execute_script("$('#procedure_description').val('description de la procedure')") fill_in 'procedure_organisation', with: 'organisme de la procedure' diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb index 41a3a3f84..6599b832b 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/features/admin/procedure_creation_spec.rb @@ -28,11 +28,13 @@ feature 'As an administrateur I wanna create a new procedure', js: true do context 'Creating a new procedure' do scenario 'Finding new procedure link' do page.find_by_id('new-procedure').click + page.find_by_id('from-scratch').click expect(page).to have_current_path(new_admin_procedure_path) end scenario 'Finding save button for new procedure, libelle and description required' do page.find_by_id('new-procedure').click + page.find_by_id('from-scratch').click page.find_by_id('save-procedure').click page.find_by_id('flash_message').visible? fill_in 'procedure_libelle', with: 'libelle de la procedure' @@ -46,6 +48,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do context 'Editing a new procedure' do before 'Create procedure' do page.find_by_id('new-procedure').click + page.find_by_id('from-scratch').click fill_in 'procedure_libelle', with: 'libelle de la procedure' page.execute_script("$('#procedure_description').val('description de la procedure')") fill_in 'procedure_organisation', with: 'organisme de la procedure'