Add avis to api

This commit is contained in:
Paul Chavard 2019-06-27 14:38:57 +02:00
parent 4d6719fe7c
commit 0d80c48b7e
3 changed files with 3 additions and 1 deletions

View file

@ -79,6 +79,7 @@ class Dossier < ApplicationRecord
piece_justificative_file_attachment: :blob piece_justificative_file_attachment: :blob
], ],
pieces_justificatives: [], pieces_justificatives: [],
avis: [],
etablissement: [], etablissement: [],
individual: [], individual: [],
user: []) user: [])

View file

@ -23,6 +23,7 @@ class DossierSerializer < ActiveModel::Serializer
has_many :pieces_justificatives has_many :pieces_justificatives
has_many :types_de_piece_justificative has_many :types_de_piece_justificative
has_one :justificatif_motivation has_one :justificatif_motivation
has_many :avis
has_many :champs, serializer: ChampSerializer has_many :champs, serializer: ChampSerializer

View file

@ -157,7 +157,7 @@ describe API::V1::DossiersController do
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, :en_construction, procedure: procedure, motivation: "Motivation") } } let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, :en_construction, procedure: procedure, motivation: "Motivation") } }
let(:dossier_id) { dossier.id } let(:dossier_id) { dossier.id }
let(:body) { JSON.parse(retour.body, symbolize_names: true) } let(:body) { JSON.parse(retour.body, symbolize_names: true) }
let(:field_list) { [:id, :created_at, :updated_at, :archived, :individual, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :motivation, :email, :instructeurs, :justificatif_motivation] } let(:field_list) { [:id, :created_at, :updated_at, :archived, :individual, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :motivation, :email, :instructeurs, :justificatif_motivation, :avis] }
subject { body[:dossier] } subject { body[:dossier] }
it 'return REST code 200', :show_in_doc do it 'return REST code 200', :show_in_doc do