cleanup in spec

This commit is contained in:
Paul Chavard 2024-08-22 17:36:47 +02:00
parent a474cf4590
commit f02ec3da82
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View file

@ -9,7 +9,7 @@ describe Champs::RepetitionController, type: :controller do
it 'removes repetition' do it 'removes repetition' do
rows, repetitions = dossier.champs.partition(&:child?) rows, repetitions = dossier.champs.partition(&:child?)
repetition = repetitions.first 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) .to change { dossier.reload.champs.size }.from(3).to(1)
end end
end end

View file

@ -50,12 +50,12 @@ describe DossierSectionsConcern do
describe '#index_for_section_header' do describe '#index_for_section_header' do
include Logic include Logic
let(:number_stable_id) { 99 } let(:number_stable_id) { 99 }
let(:types_de_champ) { let(:types_de_champ) do
[ [
{ type: :header_section, libelle: "Infos" }, { type: :integer_number, stable_id: number_stable_id }, { 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" } { 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(:procedure) { create(:procedure, :for_individual, types_de_champ_public: types_de_champ) }
let(:dossier) { create(:dossier, procedure: procedure) } let(:dossier) { create(:dossier, procedure: procedure) }