fix services choice into a procedure
This commit is contained in:
parent
d2d007fdb1
commit
2a69e2fbeb
3 changed files with 4 additions and 2 deletions
|
@ -54,6 +54,7 @@ module NewAdministrateur
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@procedure = current_administrateur.procedures.find(params[:id])
|
@procedure = current_administrateur.procedures.find(params[:id])
|
||||||
|
@current_administrateur = current_administrateur
|
||||||
if @procedure.brouillon?
|
if @procedure.brouillon?
|
||||||
@procedure_lien = commencer_test_url(path: @procedure.path)
|
@procedure_lien = commencer_test_url(path: @procedure.path)
|
||||||
else
|
else
|
||||||
|
|
|
@ -76,8 +76,8 @@
|
||||||
- else
|
- else
|
||||||
Choix du service administratif
|
Choix du service administratif
|
||||||
.card-admin-action
|
.card-admin-action
|
||||||
- if @procedure.service_id.present?
|
- if @procedure.service_id.blank? && current_administrateur.services.present?
|
||||||
= link_to 'Modifier', edit_admin_service_path(@procedure.service, procedure_id: @procedure.id), class: 'button'
|
= link_to 'Modifier', admin_services_path(procedure_id: @procedure.id), class: 'button'
|
||||||
- else
|
- else
|
||||||
= link_to 'Remplir', new_admin_service_path(procedure_id: @procedure.id), class: 'button'
|
= link_to 'Remplir', new_admin_service_path(procedure_id: @procedure.id), class: 'button'
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ describe 'new_administrateur/procedures/show.html.haml', type: :view do
|
||||||
before do
|
before do
|
||||||
assign(:procedure, procedure)
|
assign(:procedure, procedure)
|
||||||
assign(:procedure_lien, commencer_url(path: procedure.path))
|
assign(:procedure_lien, commencer_url(path: procedure.path))
|
||||||
|
allow(view).to receive(:current_administrateur).and_return(procedure.administrateurs.first)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'procedure is draft' do
|
describe 'procedure is draft' do
|
||||||
|
|
Loading…
Reference in a new issue