From 8988d6b04d9a9d15f63c7f7abd7723be3bd9ce96 Mon Sep 17 00:00:00 2001 From: mfo Date: Tue, 7 May 2024 14:22:22 +0200 Subject: [PATCH] clean(tech): linters --- app/models/procedure_revision.rb | 4 ++-- spec/components/types_de_champ_editor/champ_component_spec.rb | 1 - .../administrateurs/transitions_rules_controller_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/procedure_revision.rb b/app/models/procedure_revision.rb index 744679104e4..ff3823d9c91 100644 --- a/app/models/procedure_revision.rb +++ b/app/models/procedure_revision.rb @@ -336,9 +336,9 @@ def compare_revision_transitions_rules(new_revision) to_transitions_rules = new_revision.transitions_rules if from_transitions_rules == to_transitions_rules [] - elsif from_transitions_rules.present? && !to_transitions_rules.present? + elsif from_transitions_rules.present? && to_transitions_rules.blank? [ProcedureRevisionChange::RemoveTransitionsRule.new(self, new_revision)] - elsif !from_transitions_rules.present? && to_transitions_rules.present? + elsif from_transitions_rules.blank? && to_transitions_rules.present? [ProcedureRevisionChange::AddTransitionsRule.new(self, new_revision)] else [ProcedureRevisionChange::ChangeTransitionsRule.new(self, new_revision)] diff --git a/spec/components/types_de_champ_editor/champ_component_spec.rb b/spec/components/types_de_champ_editor/champ_component_spec.rb index 4464229540e..346c2090ede 100644 --- a/spec/components/types_de_champ_editor/champ_component_spec.rb +++ b/spec/components/types_de_champ_editor/champ_component_spec.rb @@ -4,7 +4,6 @@ let(:routing_rules_stable_ids) { [] } let(:transitions_rules_stable_ids) { [] } - before do Flipper.enable_actor(:engagement_juridique_type_de_champ, procedure) allow_any_instance_of(Procedure).to receive(:stable_ids_used_by_routing_rules).and_return(routing_rules_stable_ids) diff --git a/spec/controllers/administrateurs/transitions_rules_controller_spec.rb b/spec/controllers/administrateurs/transitions_rules_controller_spec.rb index 409a6017ad8..2910313733a 100644 --- a/spec/controllers/administrateurs/transitions_rules_controller_spec.rb +++ b/spec/controllers/administrateurs/transitions_rules_controller_spec.rb @@ -8,13 +8,13 @@ describe 'condition management' do before { sign_in(admin.user) } - let(:types_de_champ_public) { [{type: :yes_no}]} + let(:types_de_champ_public) { [{ type: :yes_no }] } let(:yes_no_tdc) { procedure.draft_revision.types_de_champ_public.first } let(:targeted_champ) { champ_value(yes_no_tdc.stable_id).to_json } let(:default_params) do { procedure_id: procedure.id, - revision_id: procedure.draft_revision.id, + revision_id: procedure.draft_revision.id } end