diff --git a/spec/services/geojson_service_spec.rb b/spec/services/geojson_service_spec.rb index ff8c949b9..c6bb3bb54 100644 --- a/spec/services/geojson_service_spec.rb +++ b/spec/services/geojson_service_spec.rb @@ -2,22 +2,13 @@ require 'spec_helper' describe GeojsonService do describe '.toGeoJsonPolygon' do - - let(:to_polygon_return) { - { - geo: { - type: "Polygon", - coordinates: [coordinates] - } - }.to_json - } - - subject { described_class.to_json_polygon coordinates } + subject { JSON.parse(described_class.to_json_polygon coordinates) } describe 'coordinates are empty' do let(:coordinates) { '' } - it { expect(subject).to eq(to_polygon_return) } + it { expect(subject['geo']['type']).to eq('Polygon') } + it { expect(subject['geo']['coordinates']).to eq([coordinates]) } end describe 'coordinates are informed' do @@ -36,7 +27,8 @@ describe GeojsonService do ] } - it { expect(subject).to eq(to_polygon_return) } + it { expect(subject['geo']['type']).to eq('Polygon') } + it { expect(subject['geo']['coordinates']).to eq([coordinates]) } end end end