Correctly check map location attr presence validations

This commit is contained in:
Bertocq
2018-02-02 21:37:05 +01:00
parent 59b600dd1a
commit 6f87f4b07c

View File

@@ -8,12 +8,13 @@ describe MapLocation do
expect(map_location).to be_valid
end
it "fails if longitude, latitude or zoom attributes are blank" do
it "is invalid when longitude/latitude/zoom are not present" do
map_location.longitude = nil
map_location.latitude = nil
map_location.zoom = nil
expect(map_location).to_not be_valid
expect(map_location.errors.size).to eq(2)
expect(map_location).not_to be_valid
expect(map_location.errors.size).to eq(3)
end
context "#available?" do