test(type_de_champ): mandatory by default, like schema

This commit is contained in:
Colin Darie 2024-06-25 17:17:51 +02:00
parent 48e5a237e3
commit f40b71f450
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
19 changed files with 89 additions and 58 deletions

View file

@ -1,6 +1,6 @@
describe PiecesJustificativesService do
describe 'pjs_for_champs' do
let(:procedure) { create(:procedure, types_de_champ_public: [{ type: :piece_justificative }, { type: :repetition, children: [{ type: :piece_justificative }] }]) }
let(:procedure) { create(:procedure, types_de_champ_public: [{ type: :piece_justificative, mandatory: false }, { type: :repetition, mandatory: false, children: [{ type: :piece_justificative, mandatory: false }] }]) }
let(:dossier) { create(:dossier, procedure: procedure) }
let(:dossiers) { Dossier.where(id: dossier.id) }
let(:witness) { create(:dossier, procedure: procedure) }
@ -477,8 +477,8 @@ describe PiecesJustificativesService do
let(:user_profile) { build(:administrateur) }
let(:types_de_champ_public) do
[
{ type: :repetition, children: [{ type: :piece_justificative }] },
{ type: :repetition, children: [{ type: :piece_justificative }, { type: :piece_justificative }] }
{ type: :repetition, mandatory: false, children: [{ type: :piece_justificative }] },
{ type: :repetition, mandatory: false, children: [{ type: :piece_justificative }, { type: :piece_justificative }] }
]
end