Browse Source

Increase soft max for old persons shared ownership savings (#2778)

pull/2783/head v0.4.84
kosiakkatrina 2 months ago committed by GitHub
parent
commit
de1d28c27e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/models/validations/sales/soft_validations.rb
  2. 27
      spec/models/validations/sales/soft_validations_spec.rb

4
app/models/validations/sales/soft_validations.rb

@ -58,7 +58,9 @@ module Validations::Sales::SoftValidations
end
def savings_over_soft_max?
savings && savings > 100_000
soft_max = form.start_year_2025_or_later? && type == 24 ? 200_000 : 100_000
savings && savings > soft_max
end
def deposit_over_soft_max?

27
spec/models/validations/sales/soft_validations_spec.rb

@ -371,6 +371,33 @@ RSpec.describe Validations::Sales::SoftValidations do
expect(record)
.not_to be_mortgage_over_soft_max
end
context "with log for 2025 of after" do
before do
record.saledate = Time.zone.local(2025, 5, 1)
end
it "allows savings over 100_000 for old persons shared ownership" do
record.savings = 100_001
record.type = 24
expect(record)
.not_to be_savings_over_soft_max
end
it "does not allows savings over 200_000 for old persons shared ownership" do
record.savings = 200_001
record.type = 24
expect(record)
.to be_savings_over_soft_max
end
it "does not allows savings over 100_000 for other type" do
record.savings = 100_001
record.type = 8
expect(record)
.to be_savings_over_soft_max
end
end
end
end

Loading…
Cancel
Save