diff --git a/app/models/form/sales/questions/property_number_of_bedrooms.rb b/app/models/form/sales/questions/property_number_of_bedrooms.rb index d06d943cf..e8ea674ea 100644 --- a/app/models/form/sales/questions/property_number_of_bedrooms.rb +++ b/app/models/form/sales/questions/property_number_of_bedrooms.rb @@ -5,7 +5,9 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question @check_answer_label = "Number of bedrooms" @header = "How many bedrooms does the property have?" @hint_text = "A bedsit has 1 bedroom" - @type = "text" + @type = "numeric" @width = 10 + @min = 1 + @max = 9 end end diff --git a/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb b/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb index fc8dc3989..cad7cb004 100644 --- a/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb +++ b/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb @@ -24,7 +24,7 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do end it "has the correct type" do - expect(question.type).to eq("text") + expect(question.type).to eq("numeric") end it "is not marked as derived" do @@ -34,4 +34,12 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do it "has the correct hint_text" do expect(question.hint_text).to eq("A bedsit has 1 bedroom") end + + it "has the correct min" do + expect(question.min).to eq(1) + end + + it "has the correct max" do + expect(question.max).to eq(9) + end end