fix services choice into a procedure

This commit is contained in:
kara Diaby 2020-09-24 14:36:22 +02:00
parent d2d007fdb1
commit 2a69e2fbeb
3 changed files with 4 additions and 2 deletions

View file

@ -54,6 +54,7 @@ module NewAdministrateur
def show
@procedure = current_administrateur.procedures.find(params[:id])
@current_administrateur = current_administrateur
if @procedure.brouillon?
@procedure_lien = commencer_test_url(path: @procedure.path)
else

View file

@ -76,8 +76,8 @@
- else
Choix du service administratif
.card-admin-action
- if @procedure.service_id.present?
= link_to 'Modifier', edit_admin_service_path(@procedure.service, procedure_id: @procedure.id), class: 'button'
- if @procedure.service_id.blank? && current_administrateur.services.present?
= link_to 'Modifier', admin_services_path(procedure_id: @procedure.id), class: 'button'
- else
= link_to 'Remplir', new_admin_service_path(procedure_id: @procedure.id), class: 'button'

View file

@ -5,6 +5,7 @@ describe 'new_administrateur/procedures/show.html.haml', type: :view do
before do
assign(:procedure, procedure)
assign(:procedure_lien, commencer_url(path: procedure.path))
allow(view).to receive(:current_administrateur).and_return(procedure.administrateurs.first)
end
describe 'procedure is draft' do