[#1833] New procedure button defaults to procedure library

This commit is contained in:
Frederic Merizen 2018-05-09 16:16:09 +02:00
parent 5fd5c3ee5b
commit 93e068421b
3 changed files with 5 additions and 1 deletions

View file

@ -6,7 +6,7 @@
.carret-right .carret-right
.carret-down .carret-down
Procédures 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 #new-procedure.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
Nouvelle Nouvelle

View file

@ -11,6 +11,7 @@ feature 'As an administrateur I wanna clone a procedure', js: true do
context 'Cloning procedure' do context 'Cloning procedure' do
before 'Create procedure' do before 'Create procedure' do
page.find_by_id('new-procedure').click page.find_by_id('new-procedure').click
page.find_by_id('from-scratch').click
fill_in 'procedure_libelle', with: 'libelle de la procedure' fill_in 'procedure_libelle', with: 'libelle de la procedure'
page.execute_script("$('#procedure_description').val('description de la procedure')") page.execute_script("$('#procedure_description').val('description de la procedure')")
fill_in 'procedure_organisation', with: 'organisme 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 context 'Creating a new procedure' do
scenario 'Finding new procedure link' do scenario 'Finding new procedure link' do
page.find_by_id('new-procedure').click page.find_by_id('new-procedure').click
page.find_by_id('from-scratch').click
expect(page).to have_current_path(new_admin_procedure_path) expect(page).to have_current_path(new_admin_procedure_path)
end end
scenario 'Finding save button for new procedure, libelle and description required' do scenario 'Finding save button for new procedure, libelle and description required' do
page.find_by_id('new-procedure').click 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('save-procedure').click
page.find_by_id('flash_message').visible? page.find_by_id('flash_message').visible?
fill_in 'procedure_libelle', with: 'libelle de la procedure' 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 context 'Editing a new procedure' do
before 'Create procedure' do before 'Create procedure' do
page.find_by_id('new-procedure').click page.find_by_id('new-procedure').click
page.find_by_id('from-scratch').click
fill_in 'procedure_libelle', with: 'libelle de la procedure' fill_in 'procedure_libelle', with: 'libelle de la procedure'
page.execute_script("$('#procedure_description').val('description de la procedure')") page.execute_script("$('#procedure_description').val('description de la procedure')")
fill_in 'procedure_organisation', with: 'organisme de la procedure' fill_in 'procedure_organisation', with: 'organisme de la procedure'