From 32bf3ec9dba57774cb53bc238127811c28c13d37 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 22 Aug 2024 17:36:47 +0200 Subject: [PATCH] cleanup in spec --- .../controllers/champs/repetition_controller_spec.rb | 2 +- .../models/concerns/dossier_sections_concern_spec.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/controllers/champs/repetition_controller_spec.rb b/spec/controllers/champs/repetition_controller_spec.rb index d2c5aca3f..583ec2c88 100644 --- a/spec/controllers/champs/repetition_controller_spec.rb +++ b/spec/controllers/champs/repetition_controller_spec.rb @@ -9,7 +9,7 @@ describe Champs::RepetitionController, type: :controller do it 'removes repetition' do rows, repetitions = dossier.champs.partition(&:child?) repetition = repetitions.first - expect { delete :remove, params: { dossier_id: repetition.dossier, stable_id: repetition.stable_id, row_id: rows.first.row_id }, format: :turbo_stream } + expect { delete :remove, params: { dossier_id: dossier, stable_id: repetition.stable_id, row_id: rows.first.row_id }, format: :turbo_stream } .to change { dossier.reload.champs.size }.from(3).to(1) end end diff --git a/spec/models/concerns/dossier_sections_concern_spec.rb b/spec/models/concerns/dossier_sections_concern_spec.rb index 43b0b556f..17f86be88 100644 --- a/spec/models/concerns/dossier_sections_concern_spec.rb +++ b/spec/models/concerns/dossier_sections_concern_spec.rb @@ -50,12 +50,12 @@ describe DossierSectionsConcern do describe '#index_for_section_header' do include Logic let(:number_stable_id) { 99 } - let(:types_de_champ) { - [ - { type: :header_section, libelle: "Infos" }, { type: :integer_number, stable_id: number_stable_id }, - { type: :header_section, libelle: "Details", condition: ds_eq(champ_value(99), constant(5)) }, { type: :header_section, libelle: "Conclusion" } - ] -} + let(:types_de_champ) do + [ + { type: :header_section, libelle: "Infos" }, { type: :integer_number, stable_id: number_stable_id }, + { type: :header_section, libelle: "Details", condition: ds_eq(champ_value(99), constant(5)) }, { type: :header_section, libelle: "Conclusion" } + ] + end let(:procedure) { create(:procedure, :for_individual, types_de_champ_public: types_de_champ) } let(:dossier) { create(:dossier, procedure: procedure) }