Merge pull request #8948 from colinux/fix-geoarea-geometry-blank

ETQ Usager, champ carte: ne permet pas d'enregistrer une geometry null pour ne pas casser les exports
This commit is contained in:
LeSim 2023-04-26 10:15:25 +02:00 committed by GitHub
commit c8ed0532ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 2 deletions

View file

@ -81,6 +81,16 @@ RSpec.describe GeoArea, type: :model do
let(:geo_area) { build(:geo_area, :invalid_right_hand_rule_polygon, champ: nil) }
it { expect(geo_area.errors).to have_key(:geometry) }
end
context "nil" do
let(:geo_area) { build(:geo_area, geometry: nil) }
it { expect(geo_area.errors).to have_key(:geometry) }
end
context "allow empty {}" do
let(:geo_area) { build(:geo_area, geometry: {}) }
it { expect(geo_area.errors).not_to have_key(:geometry) }
end
end
end