Merge pull request #8197 from colinux/fix-api-v1-dossiers-with-avis

fix(api-v1): dossier -> avis -> piece_justificative_file_attachment relation
This commit is contained in:
Colin Darie 2022-12-06 11:58:04 +01:00 committed by GitHub
commit 28dbf5ea65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) {
[