Empty instances of MapLocation won't result in a new DB record (#2220)

This commit is contained in:
Angel Perez
2018-01-08 11:46:32 -04:00
parent 6d3359dbbc
commit 665a5b57ab
7 changed files with 57 additions and 1 deletions

View File

@@ -8,6 +8,14 @@ describe MapLocation do
expect(map_location).to be_valid
end
it "fails if longitude, latitude or zoom attributes are blank" do
map_location.longitude = nil
map_location.latitude = nil
expect(map_location).to_not be_valid
expect(map_location.errors.size).to eq(2)
end
context "#available?" do
it "returns true when latitude, longitude and zoom defined" do