refactor(type_de_champ): cleanup type predicate methods

This commit is contained in:
Paul Chavard 2024-11-07 12:38:03 +01:00
parent e84071a14a
commit dc6bad40fe
No known key found for this signature in database
19 changed files with 50 additions and 161 deletions

View file

@ -71,9 +71,9 @@ describe 'Publishing a procedure', js: true do
end
before do
drop_down = procedure.draft_revision.types_de_champ_public.find(&:drop_down_list?)
drop_down = procedure.draft_revision.types_de_champ_public.find(&:any_drop_down_list?)
drop_down.update!(drop_down_options: [])
drop_down = procedure.draft_revision.types_de_champ_private.find(&:drop_down_list?)
drop_down = procedure.draft_revision.types_de_champ_private.find(&:any_drop_down_list?)
drop_down.update!(drop_down_options: [])
end

View file

@ -122,7 +122,7 @@ describe "procedure filters" do
describe 'departements' do
let(:types_de_champ_public) { [{ type: :departements }] }
scenario "should be able to find by departements with custom enum lookup", js: true do
departement_champ = new_unfollow_dossier.champs.find(&:departement?)
departement_champ = new_unfollow_dossier.champs.find(&:departements?)
departement_champ.update!(value: 'Oise', external_id: '60')
departement_champ.reload
champ_select_value = "#{departement_champ.external_id} #{departement_champ.value}"
@ -162,7 +162,7 @@ describe "procedure filters" do
describe 'region' do
let(:types_de_champ_public) { [{ type: :regions }] }
scenario "should be able to find by region with custom enum lookup", js: true do
region_champ = new_unfollow_dossier.champs.find(&:region?)
region_champ = new_unfollow_dossier.champs.find(&:regions?)
region_champ.update!(value: 'Bretagne', external_id: '53')
region_champ.reload