Validate MapLocation lat/long/zoom have numeric values
This commit is contained in:
@@ -13,6 +13,15 @@ describe MapLocation do
|
||||
map_location.latitude = nil
|
||||
map_location.zoom = nil
|
||||
|
||||
expect(map_location).not_to be_valid
|
||||
expect(map_location.errors.size).to eq(6)
|
||||
end
|
||||
|
||||
it "is invalid when longitude/latitude/zoom are not numbers" do
|
||||
map_location.longitude = 'wadus'
|
||||
map_location.latitude = 'stuff'
|
||||
map_location.zoom = '$%·'
|
||||
|
||||
expect(map_location).not_to be_valid
|
||||
expect(map_location.errors.size).to eq(3)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user