Create new procedures with administrateurs

This commit is contained in:
Paul Chavard 2019-02-26 16:38:58 +01:00
parent d72cc7db0a
commit f7af01e0dc
3 changed files with 3 additions and 2 deletions

View file

@ -67,7 +67,7 @@ class Admin::ProceduresController < AdminController
end
def create
@procedure = current_administrateur.admin_procedures.build(procedure_params)
@procedure = Procedure.new(procedure_params.merge(administrateurs: [current_administrateur]))
@path = @procedure.path
@availability = Procedure.path_availability(current_administrateur, @procedure.path)

View file

@ -13,6 +13,6 @@ namespace :after_party do
end
progress.finish
AfterParty::TaskRecord.create version: '20190214101524'
AfterParty::TaskRecord.create version: '20190226101524'
end
end

View file

@ -197,6 +197,7 @@ describe Admin::ProceduresController, type: :controller do
it { expect(subject.organisation).to eq(organisation) }
it { expect(subject.direction).to eq(direction) }
it { expect(subject.administrateur_id).to eq(admin.id) }
it { expect(subject.administrateurs).to eq([admin]) }
it { expect(subject.duree_conservation_dossiers_dans_ds).to eq(duree_conservation_dossiers_dans_ds) }
it { expect(subject.duree_conservation_dossiers_hors_ds).to eq(duree_conservation_dossiers_hors_ds) }
end