Browse Source

rebase update

pull/1077/head
Kat 3 years ago
parent
commit
a9476b6856
  1. 4
      app/models/form/sales/questions/person_age.rb
  2. 32
      spec/models/form/sales/questions/person_age_spec.rb

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

@ -5,10 +5,10 @@ class Form::Sales::Questions::PersonAge < Form::Sales::Questions::Person
@header = "Age"
@type = "numeric"
@width = 3
@inferred_check_answers_value = {
@inferred_check_answers_value = [{
"condition" => { field_for_person("age", "_known") => 1 },
"value" => "Not known",
}
}]
@check_answers_card_number = person_index
end
end

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

@ -54,10 +54,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age2_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -86,10 +86,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age3_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -118,10 +118,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age4_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -150,10 +150,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age5_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -184,10 +184,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age3_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -216,10 +216,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age4_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -248,10 +248,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age5_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do
@ -280,10 +280,10 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do
end
it "has the correct inferred check answers value" do
expect(question.inferred_check_answers_value).to eq({
expect(question.inferred_check_answers_value).to eq([{
"condition" => { "age6_known" => 1 },
"value" => "Not known",
})
}])
end
it "has the correct check_answers_card_number" do

Loading…
Cancel
Save