Browse Source

Add min and max to age2 + questions

pull/1199/head
Kat 3 years ago
parent
commit
d76ae3b7b6
  1. 2
      app/models/form/sales/questions/age2.rb
  2. 2
      app/models/form/sales/questions/person_age.rb
  3. 8
      spec/models/form/sales/questions/age2_spec.rb
  4. 8
      spec/models/form/sales/questions/person_age_spec.rb

2
app/models/form/sales/questions/age2.rb

@ -11,5 +11,7 @@ class Form::Sales::Questions::Age2 < ::Form::Question
"value" => "Not known",
}]
@check_answers_card_number = 2
@max = 110
@min = 0
end
end

2
app/models/form/sales/questions/person_age.rb

@ -10,5 +10,7 @@ class Form::Sales::Questions::PersonAge < Form::Sales::Questions::Person
"value" => "Not known",
}]
@check_answers_card_number = person_index
@min = 0
@max = 110
end
end

8
spec/models/form/sales/questions/age2_spec.rb

@ -51,4 +51,12 @@ RSpec.describe Form::Sales::Questions::Age2, type: :model do
it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(2)
end
it "has the correct min" do
expect(question.min).to eq(0)
end
it "has the correct max" do
expect(question.max).to eq(110)
end
end

8
spec/models/form/sales/questions/person_age_spec.rb

@ -32,6 +32,14 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
expect(question.hint_text).to be_nil
end
it "has the correct min" do
expect(question.min).to eq(0)
end
it "has the correct max" do
expect(question.max).to eq(110)
end
context "with not a joint purchase" do
context "and person 1" do
let(:person_index) { 2 }

Loading…
Cancel
Save