From 58417bec5a908ffcc3cf6770183dbcc0dbfaf37c Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Fri, 20 Jan 2023 17:13:31 +0000 Subject: [PATCH] test: strengthen sales property validations error addition test --- spec/models/validations/sales/property_validations_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/models/validations/sales/property_validations_spec.rb b/spec/models/validations/sales/property_validations_spec.rb index f852bee44..a44ec5479 100644 --- a/spec/models/validations/sales/property_validations_spec.rb +++ b/spec/models/validations/sales/property_validations_spec.rb @@ -66,9 +66,10 @@ RSpec.describe Validations::Sales::PropertyValidations do it "does add an error if it's a bedsit" do property_validator.validate_property_unit_type(record) - property_validator.validate_property_number_of_bedrooms(record) + expect(record.errors.added? :proptype, "Properties with 2 or more bedrooms cannot be bedsits").to be true - expect(record.errors).to be_present + property_validator.validate_property_number_of_bedrooms(record) + expect(record.errors.added? :beds, "Bedsits have at most one bedroom").to be true end end end