Merge pull request #1917 from betagouv/frederic/fix_1833-default_to_new_procedure_from_existing

[Fix #1833] Default to create new procedure by cloning an existing one
This commit is contained in:
LeSim 2018-05-09 16:35:15 +02:00 committed by GitHub
commit 783f1f113e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 5 deletions

View file

@ -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

View file

@ -1,7 +1,3 @@
.row.white-back
%a{ href: new_from_existing_admin_procedures_path, class: 'btn-sm btn-primary' }
Créer une nouvelle procédure à partir d'une procédure existante
.row.white-back
%h2
= t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure')

View file

@ -1,3 +1,7 @@
.row.white-back
%a#from-scratch{ href: new_admin_procedure_path, class: 'btn-sm btn-primary' }
Créer une nouvelle procédure de zéro
.row.white-back
%h2
Créer une nouvelle procédure à partir d'une procédure existante

View file

@ -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'

View file

@ -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'