Change logic test for GeojsonServiceSpec
This commit is contained in:
parent
141e23a381
commit
91cf5020fc
1 changed files with 5 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue