diff --git a/spec/serializers/dossier_serializer_spec.rb b/spec/serializers/dossier_serializer_spec.rb index 69c8f624c..33a883d72 100644 --- a/spec/serializers/dossier_serializer_spec.rb +++ b/spec/serializers/dossier_serializer_spec.rb @@ -49,12 +49,11 @@ describe DossierSerializer do context 'when a type de champ PJ was cloned from a legacy PJ' do let(:original_pj_id) { 3 } let(:cloned_type_de_champ) do - tdc = create(:type_de_champ_piece_justificative, + build(:type_de_champ_piece_justificative, libelle: "Vidéo de votre demande de subvention", description: "Pour optimiser vos chances, soignez la chorégraphie et privilégiez le chant polyphonique.\r\nRécupérer le formulaire vierge pour mon dossier : https://www.dance-academy.gouv.fr", - order_place: 0) - tdc.old_pj = { stable_id: original_pj_id } - tdc + old_pj: { stable_id: original_pj_id }, + position: 0) end let(:procedure) { create(:procedure, :published, types_de_champ: [cloned_type_de_champ]) } let(:dossier) { create(:dossier, procedure: procedure) } diff --git a/spec/serializers/procedure_serializer_spec.rb b/spec/serializers/procedure_serializer_spec.rb index 4271cd93e..e7f64b4bd 100644 --- a/spec/serializers/procedure_serializer_spec.rb +++ b/spec/serializers/procedure_serializer_spec.rb @@ -12,12 +12,11 @@ describe ProcedureSerializer do context 'when a type PJ was cloned to a type champ PJ' do let(:original_pj_id) { 3 } let(:cloned_type_de_champ) do - tdc = create(:type_de_champ_piece_justificative, + build(:type_de_champ_piece_justificative, libelle: "Vidéo de votre demande de subvention", description: "Pour optimiser vos chances, soignez la chorégraphie et privilégiez le chant polyphonique.\r\nRécupérer le formulaire vierge pour mon dossier : https://www.dance-academy.gouv.fr", - order_place: 0) - tdc.old_pj = { stable_id: original_pj_id } - tdc + old_pj: { stable_id: original_pj_id }, + position: 0) end let(:procedure) { create(:procedure, :published, types_de_champ: [cloned_type_de_champ]) }