Browse Source

refactor: improve test readability

pull/1444/head
natdeanlewissoftwire 3 years ago
parent
commit
8fa53dc782
  1. 4
      spec/models/validations/sales/household_validations_spec.rb

4
spec/models/validations/sales/household_validations_spec.rb

@ -75,7 +75,7 @@ RSpec.describe Validations::Sales::HouseholdValidations do
it "validates the child is at least 12 years younger than buyer 1" do it "validates the child is at least 12 years younger than buyer 1" do
record.age1 = 30 record.age1 = 30
record.age2 = 19 record.age2 = record.age1 - 13
record.relat2 = "C" record.relat2 = "C"
household_validator.validate_household_number_of_other_members(record) household_validator.validate_household_number_of_other_members(record)
expect(record.errors["age1"]) expect(record.errors["age1"])
@ -88,7 +88,7 @@ RSpec.describe Validations::Sales::HouseholdValidations do
it "expects the child is at least 12 years younger than buyer 1" do it "expects the child is at least 12 years younger than buyer 1" do
record.age1 = 30 record.age1 = 30
record.age2 = 18 record.age2 = record.age1 - 12
record.relat2 = "C" record.relat2 = "C"
household_validator.validate_household_number_of_other_members(record) household_validator.validate_household_number_of_other_members(record)
expect(record.errors["age1"]).to be_empty expect(record.errors["age1"]).to be_empty

Loading…
Cancel
Save