Merge pull request #1947 from tchak/fix-procedure-controller-test

Fix test with ordering failures
This commit is contained in:
Paul Chavard 2018-05-22 17:02:18 +02:00 committed by GitHub
commit d3ae4d86c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -232,15 +232,15 @@ class Admin::ProceduresController < AdminController
def path_list
json_path_list = ProcedurePath
.joins(', procedures')
.where("procedures.id = procedure_paths.procedure_id")
.where("procedures.archived_at" => nil)
.joins(:procedure)
.where(procedures: { archived_at: nil })
.where("path LIKE ?", "%#{params[:request]}%")
.order(:id)
.pluck(:path, :administrateur_id)
.map do |value|
.map do |path, administrateur_id|
{
label: value.first,
mine: value.second == current_administrateur.id
label: path,
mine: administrateur_id == current_administrateur.id
}
end.to_json