diff --git a/app/models/groupe_instructeur.rb b/app/models/groupe_instructeur.rb index f7ecf059d..524d9e9c8 100644 --- a/app/models/groupe_instructeur.rb +++ b/app/models/groupe_instructeur.rb @@ -92,7 +92,7 @@ class GroupeInstructeur < ApplicationRecord end def valid_rule_line?(rule) - ([rule.left, rule, rule.right] in [ChampValue, (LessThan | LessThanEq | Eq | NotEq | GreaterThanEq | GreaterThan | IncludeOperator | ExcludeOperator), Constant]) && routing_rule_matches_tdc?(rule) + !rule.is_a?(EmptyOperator) && routing_rule_matches_tdc?(rule) end def non_unique_rule? diff --git a/spec/models/routing_engine_spec.rb b/spec/models/routing_engine_spec.rb index 36ea5bc63..4692638d7 100644 --- a/spec/models/routing_engine_spec.rb +++ b/spec/models/routing_engine_spec.rb @@ -28,7 +28,7 @@ describe RoutingEngine, type: :model do context 'without any matching rules' do before do procedure.groupe_instructeurs.each do |gi| - gi.update(routing_rule: ds_eq(constant(false), constant(false))) + gi.update(routing_rule: ds_eq(constant(false), constant(true))) end end