Browse Source

Add max range to mortgage length (#1245)

pull/1246/head
Jack 2 years ago committed by GitHub
parent
commit
9d80f6d245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/models/form/sales/questions/mortgage_length.rb
  2. 4
      spec/models/form/sales/questions/mortgage_length_spec.rb

1
app/models/form/sales/questions/mortgage_length.rb

@ -6,6 +6,7 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question
@header = "What is the length of the mortgage?" @header = "What is the length of the mortgage?"
@type = "numeric" @type = "numeric"
@min = 0 @min = 0
@max = 60
@width = 5 @width = 5
@suffix = " years" @suffix = " years"
@hint_text = "You should round up to the nearest year. Value should not exceed 60 years." @hint_text = "You should round up to the nearest year. Value should not exceed 60 years."

4
spec/models/form/sales/questions/mortgage_length_spec.rb

@ -48,4 +48,8 @@ RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do
it "has correct min" do it "has correct min" do
expect(question.min).to eq(0) expect(question.min).to eq(0)
end end
it "has correct max" do
expect(question.max).to eq(60)
end
end end

Loading…
Cancel
Save