Browse Source

Add min and max for frombeds

pull/1219/head
Kat 3 years ago
parent
commit
1bc1dbe65a
  1. 3
      app/models/form/sales/questions/previous_bedrooms.rb
  2. 6
      spec/models/form/sales/questions/previous_bedrooms_spec.rb

3
app/models/form/sales/questions/previous_bedrooms.rb

@ -6,7 +6,8 @@ class Form::Sales::Questions::PreviousBedrooms < ::Form::Question
@header = "How many bedrooms did the property have?" @header = "How many bedrooms did the property have?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@min = 0 @min = 1
@max = 6
@hint_text = "For bedsits enter 1" @hint_text = "For bedsits enter 1"
end end
end end

6
spec/models/form/sales/questions/previous_bedrooms_spec.rb

@ -40,6 +40,10 @@ RSpec.describe Form::Sales::Questions::PreviousBedrooms, type: :model do
end end
it "has correct min" do it "has correct min" do
expect(question.min).to eq(0) expect(question.min).to eq(1)
end
it "has correct max" do
expect(question.max).to eq(6)
end end
end end

Loading…
Cancel
Save