feat(routing): add regions to routable_type_de_champ
This commit is contained in:
parent
c9bde31ef2
commit
5afaa458e2
2 changed files with 3 additions and 2 deletions
|
@ -224,7 +224,7 @@ class ProcedureRevision < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def routable_types_de_champ
|
def routable_types_de_champ
|
||||||
types_de_champ_public.filter { |tdc| [:drop_down_list, :departements].include?(tdc.type_champ.to_sym) }
|
types_de_champ_public.filter { |tdc| [:drop_down_list, :departements, :regions].include?(tdc.type_champ.to_sym) }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -948,9 +948,10 @@ describe ProcedureRevision do
|
||||||
p.draft_revision.add_type_de_champ(type_champ: :text, libelle: 'l1')
|
p.draft_revision.add_type_de_champ(type_champ: :text, libelle: 'l1')
|
||||||
p.draft_revision.add_type_de_champ(type_champ: :drop_down_list, libelle: 'l2')
|
p.draft_revision.add_type_de_champ(type_champ: :drop_down_list, libelle: 'l2')
|
||||||
p.draft_revision.add_type_de_champ(type_champ: :departements, libelle: 'l3')
|
p.draft_revision.add_type_de_champ(type_champ: :departements, libelle: 'l3')
|
||||||
|
p.draft_revision.add_type_de_champ(type_champ: :regions, libelle: 'l4')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(draft.routable_types_de_champ.pluck(:libelle)).to eq(['l2', 'l3']) }
|
it { expect(draft.routable_types_de_champ.pluck(:libelle)).to eq(['l2', 'l3', 'l4']) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue