Service: cannot published a procedure without a service
This commit is contained in:
parent
abccdab6ab
commit
f2357acb27
2 changed files with 10 additions and 2 deletions
|
@ -4,8 +4,13 @@
|
|||
.row.white-back
|
||||
#procedure_show
|
||||
- if procedure.brouillon?
|
||||
- if procedure.gestionnaires.size == 0
|
||||
%a.action_button.btn.btn-success#publish-procedure{ style: 'float: right; margin-top: 10px;', disabled: 'disabled', 'data-toggle' => :tooltip, title: 'Vous ne pouvez pas publier une procédure sans qu\'aucun accompagnateur ne soit affecté à celle-ci.' }
|
||||
- if procedure.gestionnaires.empty? || procedure.service.nil?
|
||||
- message = ''
|
||||
- if procedure.gestionnaires.empty?
|
||||
- message += 'Affectez des accompagnateurs à votre procédure.'
|
||||
- if procedure.service.nil?
|
||||
- message += 'Affectez un service à votre procédure.'
|
||||
%a.action_button.btn.btn-success#publish-procedure{ style: 'float: right; margin-top: 10px;', disabled: 'disabled', 'data-toggle' => :tooltip, title: message }
|
||||
%i.fa.fa-eraser
|
||||
Publier
|
||||
- else
|
||||
|
|
|
@ -53,6 +53,9 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
|||
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
||||
fill_in 'procedure_organisation', with: 'organisme de la procedure'
|
||||
page.find_by_id('save-procedure').click
|
||||
|
||||
procedure = Procedure.last
|
||||
procedure.update(service: create(:service))
|
||||
end
|
||||
|
||||
scenario 'Add champ, add file, visualize them in procedure preview' do
|
||||
|
|
Loading…
Reference in a new issue