diff --git a/app/models/concerns/dossier_searchable_concern.rb b/app/models/concerns/dossier_searchable_concern.rb index 78eb5dd02..2b52fe668 100644 --- a/app/models/concerns/dossier_searchable_concern.rb +++ b/app/models/concerns/dossier_searchable_concern.rb @@ -18,7 +18,9 @@ module DossierSearchableConcern *champs_public.flat_map(&:search_terms), *etablissement&.search_terms, individual&.nom, - individual&.prenom + individual&.prenom, + mandataire_first_name, + mandataire_last_name ].compact_blank.join(' ') private_search_terms = champs_private.flat_map(&:search_terms).compact_blank.join(' ') diff --git a/spec/models/concerns/dossier_searchable_concern_spec.rb b/spec/models/concerns/dossier_searchable_concern_spec.rb index ae9325d7d..069a6696e 100644 --- a/spec/models/concerns/dossier_searchable_concern_spec.rb +++ b/spec/models/concerns/dossier_searchable_concern_spec.rb @@ -56,5 +56,13 @@ describe DossierSearchableConcern do end end end + + context 'mandataire' do + it "update columns" do + dossier.update(mandataire_first_name: "Chris") + perform_enqueued_jobs(only: DossierIndexSearchTermsJob) + expect(result["search_terms"]).to include("Chris") + end + end end end