Browse Source

Add max range to mortgage length

pull/1245/head
Jack S 3 years ago
parent
commit
5d42c0eb4f
  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