Merge pull request #4007 from tchak/avis-api

Add avis to api
This commit is contained in:
Paul Chavard 2019-06-27 15:25:04 +02:00 committed by GitHub
commit c9672cf1b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View file

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

View file

@ -23,6 +23,7 @@ class DossierSerializer < ActiveModel::Serializer
has_many :pieces_justificatives
has_many :types_de_piece_justificative
has_one :justificatif_motivation
has_many :avis
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_id) { dossier.id }
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] }
it 'return REST code 200', :show_in_doc do