Add state to ProcedureSerializer

This commit is contained in:
Paul Chavard 2018-10-22 19:23:30 +02:00
parent 4ebc0b7f4c
commit 2e7a4a4098
2 changed files with 7 additions and 1 deletions

View file

@ -10,7 +10,8 @@ class ProcedureSerializer < ActiveModel::Serializer
:archived_at,
:geographic_information,
:total_dossier,
:link
:link,
:state
has_one :geographic_information, serializer: ModuleApiCartoSerializer
has_many :types_de_champ, serializer: TypeDeChampSerializer
@ -26,4 +27,8 @@ class ProcedureSerializer < ActiveModel::Serializer
end
end
end
def state
object.aasm_state
end
end

View file

@ -5,6 +5,7 @@ describe ProcedureSerializer do
it {
is_expected.to include(link: "http://localhost:3000/commencer/#{procedure.path}")
is_expected.to include(state: "publiee")
}
end
end