Correctly check map location attr presence validations
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user