diff --git a/app/models/form/sales/questions/deposit_amount.rb b/app/models/form/sales/questions/deposit_amount.rb index b054f76f2..31df2c5fd 100644 --- a/app/models/form/sales/questions/deposit_amount.rb +++ b/app/models/form/sales/questions/deposit_amount.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question @type = "numeric" @min = 0 @width = 5 + @max = 9_999_999 @prefix = "£" @hint_text = "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage" end diff --git a/app/models/sales_log.rb b/app/models/sales_log.rb index 22f750148..193d0b036 100644 --- a/app/models/sales_log.rb +++ b/app/models/sales_log.rb @@ -1,7 +1,9 @@ class SalesLogValidator < ActiveModel::Validator include Validations::Sales::HouseholdValidations - include Validations::SharedValidations include Validations::Sales::FinancialValidations + include Validations::Sales::SaleInformationValidations + + include Validations::SharedValidations include Validations::LocalAuthorityValidations def validate(record) diff --git a/spec/models/form/sales/questions/deposit_amount_spec.rb b/spec/models/form/sales/questions/deposit_amount_spec.rb index 9eaa628cf..ee580ffd1 100644 --- a/spec/models/form/sales/questions/deposit_amount_spec.rb +++ b/spec/models/form/sales/questions/deposit_amount_spec.rb @@ -46,4 +46,8 @@ RSpec.describe Form::Sales::Questions::DepositAmount, type: :model do it "has correct min" do expect(question.min).to eq(0) end + + it "has correct max" do + expect(question.max).to eq(9_999_999) + end end diff --git a/spec/requests/form_controller_spec.rb b/spec/requests/form_controller_spec.rb index 853bf7978..3a3da8e5e 100644 --- a/spec/requests/form_controller_spec.rb +++ b/spec/requests/form_controller_spec.rb @@ -658,7 +658,7 @@ RSpec.describe FormController, type: :request do let(:referrer) { "/lettings-logs/#{completed_lettings_log.id}/net-income-value-check?referrer=check_answers" } before do - completed_lettings_log.update!(ecstat1: 1, earnings: 130, hhmemb: 1) # we're not routing to that page, so it gets cleared?§ + completed_lettings_log.update!(ecstat1: 1, earnings: 130, hhmemb: 1) # we're not routing to that page, so it gets cleared? allow(completed_lettings_log).to receive(:net_income_soft_validation_triggered?).and_return(true) allow(completed_lettings_log.form).to receive(:end_date).and_return(Time.zone.today + 1.day) post "/lettings-logs/#{completed_lettings_log.id}/form", params: interrupt_params, headers: headers.merge({ "HTTP_REFERER" => referrer })