From 9c555416fca9b5e8393f94b9cac9d4b8d689779a Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 18 Jan 2023 11:15:44 +0000 Subject: [PATCH] tests: refactor --- .../sales/household_validations_spec.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/models/validations/sales/household_validations_spec.rb b/spec/models/validations/sales/household_validations_spec.rb index bfbae6fda..95313db7d 100644 --- a/spec/models/validations/sales/household_validations_spec.rb +++ b/spec/models/validations/sales/household_validations_spec.rb @@ -72,14 +72,15 @@ RSpec.describe Validations::Sales::HouseholdValidations do expect(record.errors["age2"]).to be_empty end - it "validates that a person under 16 must not be a partner of the buyer" - record.age2 = 14 - record.relat2 = "P" - household_validator.validate_household_number_of_other_members(record) - expect(record.errors["relat2"]) - .to include(match I18n.t("validations.household.relat.partner_under_16")) - expect(record.errors["age2"]) - .to include(match I18n.t("validations.household.age.partner_under_16")) + it "validates that a person under 16 must not be a partner of the buyer" do + record.age2 = 14 + record.relat2 = "P" + household_validator.validate_household_number_of_other_members(record) + expect(record.errors["relat2"]) + .to include(match I18n.t("validations.household.relat.partner_under_16")) + expect(record.errors["age2"]) + .to include(match I18n.t("validations.household.age.partner_under_16")) + end end it "validates that a person over 20 must not be a child of the buyer" do