From 9d80f6d245054408c012a99adc3357e1f2f3d614 Mon Sep 17 00:00:00 2001 From: Jack <113976590+bibblobcode@users.noreply.github.com> Date: Fri, 27 Jan 2023 09:03:16 +0000 Subject: [PATCH] Add max range to mortgage length (#1245) --- app/models/form/sales/questions/mortgage_length.rb | 1 + spec/models/form/sales/questions/mortgage_length_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/models/form/sales/questions/mortgage_length.rb b/app/models/form/sales/questions/mortgage_length.rb index 56a358f01..3f1603b75 100644 --- a/app/models/form/sales/questions/mortgage_length.rb +++ b/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?" @type = "numeric" @min = 0 + @max = 60 @width = 5 @suffix = " years" @hint_text = "You should round up to the nearest year. Value should not exceed 60 years." diff --git a/spec/models/form/sales/questions/mortgage_length_spec.rb b/spec/models/form/sales/questions/mortgage_length_spec.rb index e96a05174..0f3193244 100644 --- a/spec/models/form/sales/questions/mortgage_length_spec.rb +++ b/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 expect(question.min).to eq(0) end + + it "has correct max" do + expect(question.max).to eq(60) + end end