it"does not add an error if input is an integer"do
sales_log.income1=30_000
shared_validator.validate_numeric_step(sales_log)
expect(sales_log.errors).tobe_empty
end
end
context"when validating a question with a step of 10"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")
end
it"does not add an error if input is a multiple of ten"do
sales_log.savings=30_000
shared_validator.validate_numeric_step(sales_log)
expect(sales_log.errors).tobe_empty
end
end
context"when validating a question with a step of 0.01"do
it"adds an error if input has more than 2 decimal places"do