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:
commit
c8ed0532ed
5 changed files with 30 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue