Fix geo areas computations

This commit is contained in:
Paul Chavard 2020-10-01 11:32:56 +02:00
parent 569433bacb
commit 4dfc1c719f
4 changed files with 75 additions and 7 deletions

View file

@ -2,15 +2,13 @@ RSpec.describe GeoArea, type: :model do
describe '#area' do
let(:geo_area) { build(:geo_area, :polygon) }
it { expect(geo_area.area).to eq(219.0) }
it { expect(geo_area.area).to eq(103.6) }
end
describe '#area (hourglass polygon)' do
let(:geo_area) { build(:geo_area, :hourglass_polygon) }
# This test fails in my local environement end the problem exists in production.
# Must be some mismatch between CI/production. I still want this fix in production.
it.pending { expect(geo_area.area).to be_nil }
it { expect(geo_area.area).to eq(32.4) }
end
describe '#length' do