tech: use facet_id to sort fields

This commit is contained in:
mfo 2024-07-22 11:32:07 +02:00
parent 743ff8c8a9
commit b6464c1963
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
10 changed files with 38 additions and 18 deletions

View file

@ -872,6 +872,24 @@ describe Instructeurs::ProceduresController, type: :controller do
end
end
describe '#update_filter' do
let(:instructeur) { create(:instructeur) }
let(:procedure) { create(:procedure, :for_individual) }
def procedure_presentation = instructeur.assign_to.first.procedure_presentation_or_default_and_errors.first
before do
create(:assign_to, instructeur:, groupe_instructeur: build(:groupe_instructeur, procedure:))
sign_in(instructeur.user)
end
it 'can change order' do
expect { get :update_sort, params: { procedure_id: procedure.id, facet_id: "individual/nom", order: 'asc' } }
.to change { procedure_presentation.sort }
.from({ "column" => "notifications", "order" => "desc", "table" => "notifications" })
.to({ "column" => "nom", "order" => "asc", "table" => "individual" })
end
end
describe '#add_filter' do
let(:instructeur) { create(:instructeur) }
let(:procedure) { create(:procedure, :for_individual) }