From 6f87f4b07c015bf6468a3aeb1642332665817d5a Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 2 Feb 2018 21:37:05 +0100 Subject: [PATCH] Correctly check map location attr presence validations --- spec/models/map_location_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/models/map_location_spec.rb b/spec/models/map_location_spec.rb index 0bfb71212..cc54fda6f 100644 --- a/spec/models/map_location_spec.rb +++ b/spec/models/map_location_spec.rb @@ -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