Browse Source

Infer check answers value for age questions as 'Not known'

pull/1068/head
Kat 4 years ago
parent
commit
6f69fe9469
  1. 6
      app/models/form/sales/questions/age1.rb
  2. 4
      app/models/form/sales/questions/age2.rb
  3. 4
      app/models/form/sales/questions/person1_age.rb
  4. 4
      app/models/form/sales/questions/person2_age.rb
  5. 4
      app/models/form/sales/questions/person3_age.rb
  6. 4
      app/models/form/sales/questions/person4_age.rb
  7. 7
      spec/models/form/sales/questions/age1_spec.rb
  8. 9
      spec/models/form/sales/questions/age2_spec.rb
  9. 7
      spec/models/form/sales/questions/person1_age_spec.rb
  10. 7
      spec/models/form/sales/questions/person2_age_spec.rb
  11. 7
      spec/models/form/sales/questions/person3_age_spec.rb
  12. 7
      spec/models/form/sales/questions/person4_age_spec.rb

6
app/models/form/sales/questions/age1.rb

@ -7,5 +7,11 @@ class Form::Sales::Questions::Age1 < ::Form::Question
@type = "numeric" @type = "numeric"
@page = page @page = page
@width = 2 @width = 2
@inferred_check_answers_value = {
"condition" => {
"age1_known" => 1
},
"value" => "Not known"
}
end end
end end

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

@ -7,5 +7,9 @@ class Form::Sales::Questions::Age2 < ::Form::Question
@type = "numeric" @type = "numeric"
@page = page @page = page
@width = 2 @width = 2
@inferred_check_answers_value = {
"condition" => { "age2_known" => 1 },
"value" => "Not known"
}
end end
end end

4
app/models/form/sales/questions/person1_age.rb

@ -7,5 +7,9 @@ class Form::Sales::Questions::Person1Age < ::Form::Question
@type = "numeric" @type = "numeric"
@page = page @page = page
@width = 3 @width = 3
@inferred_check_answers_value = {
"condition" => { "age3_known" => 1 },
"value" => "Not known"
}
end end
end end

4
app/models/form/sales/questions/person2_age.rb

@ -7,5 +7,9 @@ class Form::Sales::Questions::Person2Age < ::Form::Question
@type = "numeric" @type = "numeric"
@page = page @page = page
@width = 3 @width = 3
@inferred_check_answers_value = {
"condition" => { "age4_known" => 1 },
"value" => "Not known"
}
end end
end end

4
app/models/form/sales/questions/person3_age.rb

@ -7,5 +7,9 @@ class Form::Sales::Questions::Person3Age < ::Form::Question
@type = "numeric" @type = "numeric"
@page = page @page = page
@width = 3 @width = 3
@inferred_check_answers_value = {
"condition" => { "age5_known" => 1 },
"value" => "Not known"
}
end end
end end

4
app/models/form/sales/questions/person4_age.rb

@ -7,5 +7,9 @@ class Form::Sales::Questions::Person4Age < ::Form::Question
@type = "numeric" @type = "numeric"
@page = page @page = page
@width = 3 @width = 3
@inferred_check_answers_value = {
"condition" => { "age6_known" => 1 },
"value" => "Not known"
}
end end
end end

7
spec/models/form/sales/questions/age1_spec.rb

@ -38,4 +38,11 @@ RSpec.describe Form::Sales::Questions::Age1, type: :model do
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(2) expect(question.width).to eq(2)
end end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
"condition" => { "age1_known" => 1},
"value" => "Not known"
})
end
end end

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

@ -38,4 +38,13 @@ RSpec.describe Form::Sales::Questions::Age2, type: :model do
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(2) expect(question.width).to eq(2)
end end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
"condition" => {
"age2_known" => 1
},
"value" => "Not known"
})
end
end end

7
spec/models/form/sales/questions/person1_age_spec.rb

@ -38,4 +38,11 @@ RSpec.describe Form::Sales::Questions::Person1Age, type: :model do
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(3) expect(question.width).to eq(3)
end end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
"condition" => {"age3_known" => 1},
"value" => "Not known"
})
end
end end

7
spec/models/form/sales/questions/person2_age_spec.rb

@ -38,4 +38,11 @@ RSpec.describe Form::Sales::Questions::Person2Age, type: :model do
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(3) expect(question.width).to eq(3)
end end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
"condition" => {"age4_known" => 1},
"value" => "Not known"
})
end
end end

7
spec/models/form/sales/questions/person3_age_spec.rb

@ -38,4 +38,11 @@ RSpec.describe Form::Sales::Questions::Person3Age, type: :model do
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(3) expect(question.width).to eq(3)
end end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
"condition" => {"age5_known" => 1},
"value" => "Not known"
})
end
end end

7
spec/models/form/sales/questions/person4_age_spec.rb

@ -38,4 +38,11 @@ RSpec.describe Form::Sales::Questions::Person4Age, type: :model do
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(3) expect(question.width).to eq(3)
end end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
"condition" => {"age6_known" => 1},
"value" => "Not known"
})
end
end end

Loading…
Cancel
Save