fix(api-v1): dossier -> avis -> piece_justificative_file_attachment relation name

This commit is contained in:
Colin Darie 2022-12-06 09:45:59 +01:00
parent 6207e633d7
commit 4ba76e6844
2 changed files with 9 additions and 1 deletions

View file

@ -280,7 +280,7 @@ class Dossier < ApplicationRecord
.includes(commentaires: { piece_jointe_attachment: :blob },
justificatif_motivation_attachment: :blob,
attestation: [],
avis: { piece_justificative_file_attachments: :blob },
avis: { piece_justificative_file_attachment: :blob },
traitement: [],
etablissement: [],
individual: [],

View file

@ -316,6 +316,14 @@ describe API::V1::DossiersController do
it { expect(subject.first[:email]).to eq 'plop@plip.com' }
end
describe 'avis' do
let!(:avis) { create(:avis, dossier: dossier) }
subject { super()[:avis] }
it { expect(subject[0][:introduction]).to eq(avis.introduction) }
end
describe 'etablissement' do
let(:field_list) {
[