refactor(routing): toggle routing when simple routing

This commit is contained in:
Eric Leroy-Terquem 2023-06-27 10:18:08 +02:00
parent f03d10e246
commit 520050933e
2 changed files with 2 additions and 1 deletions

View file

@ -48,7 +48,7 @@ module Administrateurs
gi.update(routing_rule: ds_eq(champ_value(stable_id), constant(gi.label)))
end
defaut = @procedure.defaut_groupe_instructeur
defaut = @procedure.defaut_groupe_instructeur.tap(&:toggle_routing)
if !tdc_options.include?(defaut.label)
new_defaut = @procedure.reload.groupe_instructeurs_but_defaut.first

View file

@ -723,6 +723,7 @@ describe Administrateurs::GroupeInstructeursController, type: :controller do
expect(flash.notice).to eq 'Les groupes instructeurs ont été ajoutés'
expect(procedure3.groupe_instructeurs.pluck(:label)).to match_array(['Paris', 'Lyon', 'Marseille'])
expect(procedure3.reload.defaut_groupe_instructeur.routing_rule).to eq(ds_eq(champ_value(drop_down_tdc.stable_id), constant('Lyon')))
expect(procedure3.routing_enabled).to be_truthy
end
end
end