@ -7,5 +7,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question
@hint_text = "A bedsit has 1 bedroom"
@type = "numeric"
@width = 10
@min = 1
@max = 9
end
@ -7,12 +7,4 @@ module Validations::Sales::PropertyValidations
record.errors.add :ppostcode_full, I18n.t("validations.property.postcode.must_match_previous")
def validate_bedroom_number(record)
return unless record.beds
unless record.beds.between?(1, 9)
record.errors.add :beds, I18n.t("validations.property.beds.1_9")
@ -195,7 +195,6 @@ en:
beds:
non_positive: "Number of bedrooms has to be greater than 0"
over_max: "Number of bedrooms cannot be more than 12"
1_9: "Bedroom number must be 1-9"
postcode:
must_match_previous: "Buyer's last accommodation and discounted ownership postcodes must match"
@ -36,10 +36,10 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do
it "has the correct min" do
expect(question.min).to eq(nil)
expect(question.min).to eq(1)
it "has the correct max" do
expect(question.max).to eq(nil)
expect(question.max).to eq(9)