feat(conditional): can condition and route with pays tdc
This commit is contained in:
parent
b02f95336f
commit
b29893a843
3 changed files with 41 additions and 3 deletions
|
@ -181,6 +181,29 @@ describe RoutingEngine, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with a pays type de champ' do
|
||||
let(:procedure) do
|
||||
create(:procedure, types_de_champ_public: [{ type: :pays }]).tap do |p|
|
||||
p.groupe_instructeurs.create(label: 'a third group')
|
||||
end
|
||||
end
|
||||
|
||||
let(:pays_tdc) { procedure.draft_revision.types_de_champ.first }
|
||||
|
||||
context 'with a matching rule' do
|
||||
before do
|
||||
gi_2.update(routing_rule: ds_eq(champ_value(pays_tdc.stable_id), constant('BE')))
|
||||
dossier.champs.first.update_columns(
|
||||
value: "Belgique"
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to eq(gi_2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'routing rules priorities' do
|
||||
let(:procedure) do
|
||||
create(:procedure,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue