cleanup in spec

This commit is contained in:
Paul Chavard 2024-08-22 17:36:47 +02:00
parent 5edb8749c0
commit 32bf3ec9db
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
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

View file

@ -50,12 +50,12 @@ describe DossierSectionsConcern do
describe '#index_for_section_header' do
include Logic
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: "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) }