expect(sales_log.errors["savings"]).toinclude(matchI18n.t("validations.numeric.above_min",field:"Buyer’s total savings (to nearest £10) before any deposit paid",min:"£0"))
expect(sales_log.errors["savings"]).toinclude(matchI18n.t("validations.numeric.above_min",field:"Buyer’s total savings before any deposit paid",min:"£0"))
end
context"when validating percent"do
@ -139,13 +139,13 @@ RSpec.describe Validations::SharedValidations do
it"adds an error if input is not a multiple of ten"do
sales_log.savings=30_005
shared_validator.validate_numeric_step(sales_log)
expect(sales_log.errors[:savings]).toincludeI18n.t("validations.numeric.nearest_ten",field:"Buyer’s total savings (to nearest £10) before any deposit paid")
expect(sales_log.errors[:savings]).toincludeI18n.t("validations.numeric.nearest_ten",field:"Buyer’s total savings before any deposit paid")
end
it"adds an error if the user attempts to input a number in exponent format"do
sales_log.savings="3e5"
shared_validator.validate_numeric_step(sales_log)
expect(sales_log.errors[:savings]).toincludeI18n.t("validations.numeric.nearest_ten",field:"Buyer’s total savings (to nearest £10) before any deposit paid")
expect(sales_log.errors[:savings]).toincludeI18n.t("validations.numeric.nearest_ten",field:"Buyer’s total savings before any deposit paid")
end
it"does not add an error if input is a multiple of ten"do