link procedure to administrateur

This commit is contained in:
Tanguy PATTE 2015-11-16 18:25:31 +01:00
parent 2696a6098e
commit 9942525984
2 changed files with 3 additions and 1 deletions

View file

@ -45,6 +45,6 @@ class Admin::ProceduresController < AdminController
private
def create_procedure_params
params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :use_api_carto)
params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :use_api_carto).merge(administrateur_id: current_administrateur.id)
end
end

View file

@ -78,6 +78,8 @@ describe Admin::ProceduresController, type: :controller do
it { expect(subject.direction).to eq(direction) }
it { expect(subject.lien_demarche).to eq(lien_demarche) }
it { expect(subject.use_api_carto).to be_truthy }
it { expect(subject.administrateur_id).to eq(admin.id) }
end
it { expect(subject).to redirect_to(admin_procedures_path) }