feat(procedure_serializer): just add an empty string for direction
This commit is contained in:
parent
6752da40a9
commit
1f8bf201a2
2 changed files with 7 additions and 1 deletions
|
@ -10,7 +10,8 @@ class ProcedureSerializer < ActiveModel::Serializer
|
|||
:geographic_information,
|
||||
:total_dossier,
|
||||
:link,
|
||||
:state
|
||||
:state,
|
||||
:direction
|
||||
|
||||
has_one :geographic_information, serializer: ModuleAPICartoSerializer
|
||||
has_many :types_de_champ, serializer: TypeDeChampSerializer
|
||||
|
@ -18,6 +19,10 @@ class ProcedureSerializer < ActiveModel::Serializer
|
|||
has_many :types_de_piece_justificative
|
||||
belongs_to :service, serializer: ServiceSerializer
|
||||
|
||||
def direction
|
||||
""
|
||||
end
|
||||
|
||||
def archived_at
|
||||
object.closed_at&.in_time_zone('UTC')
|
||||
end
|
||||
|
|
|
@ -35,6 +35,7 @@ describe API::V1::ProceduresController, type: :controller do
|
|||
it { expect(subject[:description]).to eq(procedure.description) }
|
||||
it { expect(subject[:organisation]).to eq(procedure.organisation) }
|
||||
it { expect(subject[:archived_at]).to eq(procedure.closed_at) }
|
||||
it { expect(subject[:direction]).to eq("") }
|
||||
it { expect(subject[:total_dossier]).to eq(procedure.total_dossier) }
|
||||
it { is_expected.to have_key(:types_de_champ) }
|
||||
it { expect(subject[:types_de_champ]).to be_an(Array) }
|
||||
|
|
Loading…
Add table
Reference in a new issue