diff --git a/app/models/form/sales/questions/person_age.rb b/app/models/form/sales/questions/person_age.rb index 74e140f32..53609f5c0 100644 --- a/app/models/form/sales/questions/person_age.rb +++ b/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 diff --git a/spec/models/form/sales/questions/person_age_spec.rb b/spec/models/form/sales/questions/person_age_spec.rb index b1eacfed5..b291a366c 100644 --- a/spec/models/form/sales/questions/person_age_spec.rb +++ b/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