cleanup in spec
This commit is contained in:
parent
a474cf4590
commit
f02ec3da82
2 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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) }
|
||||
|
|
Loading…
Reference in a new issue