Expose the motivation on the API

This commit is contained in:
gregoirenovel 2017-06-15 17:36:30 +02:00
parent 8222a7dc28
commit ce2def9c40
3 changed files with 4 additions and 2 deletions

View file

@ -9,6 +9,7 @@ class DossierSerializer < ActiveModel::Serializer
:initiated_at,
:received_at,
:processed_at,
:motivation,
:accompagnateurs,
:invites

View file

@ -50,6 +50,7 @@
"initiated_at": "2017-04-11T12:00:12.000Z",
"received_at": null,
"processed_at": null,
"motivation": null,
"accompagnateurs": [
"gestionnaire@apientreprise.fr"
],

View file

@ -111,10 +111,10 @@ describe API::V1::DossiersController do
context 'when dossier exists and belongs to procedure' do
let(:procedure_id) { procedure.id }
let(:date_creation) { Time.utc(2008, 9, 1, 10, 5, 0) }
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, procedure: procedure) } }
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, 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, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :accompagnateurs, :invites] }
let(:field_list) { [:id, :created_at, :updated_at, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :motivation, :accompagnateurs, :invites] }
subject { body[:dossier] }
it 'return REST code 200', :show_in_doc do