Revert legacy carte API to parsed json

This commit is contained in:
Paul Chavard 2018-12-05 16:02:47 +01:00
parent d1825b7b3c
commit ee93b4e33d
2 changed files with 3 additions and 2 deletions

View file

@ -12,7 +12,7 @@ class ChampSerializer < ActiveModel::Serializer
def value
case object
when GeoArea
object.geometry.to_json
object.geometry
when Champs::CarteChamp
if object.geo_json.present?
object.geo_json.to_json

View file

@ -46,7 +46,7 @@ describe ChampSerializer do
let(:serialized_id) { -1 }
let(:serialized_description) { "" }
let(:serialized_order_place) { -1 }
let(:serialized_value) { geo_json }
let(:serialized_value) { parsed_geo_json }
context 'and geo_area is selection_utilisateur' do
context 'value is empty' do
@ -102,6 +102,7 @@ describe ChampSerializer do
let(:serialized_order_place) { champ.order_place }
let(:serialized_libelle) { champ.libelle }
let(:serialized_type_champ) { champ.type_champ }
let(:serialized_value) { geo_json }
context 'when value is coordinates' do
let(:value) { coordinates.to_json }