From 4d59a489cf9a24f0bbc68a893cbf6fa0eb1f8729 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 17 Jan 2023 16:46:20 +0000 Subject: [PATCH] Add prefers not to say as the displayed value for all household members --- .../questions/buyer1_working_situation.rb | 6 +++ .../buyer2_relationship_to_buyer1.rb | 6 +++ .../questions/buyer2_working_situation.rb | 6 +++ .../form/sales/questions/gender_identity2.rb | 6 +++ .../form/sales/questions/nationality1.rb | 6 +++ .../sales/questions/person_gender_identity.rb | 6 +++ .../person_relationship_to_buyer_1.rb | 6 +++ .../questions/person_working_situation.rb | 6 +++ .../buyer1_working_situation_spec.rb | 6 +++ .../buyer2_relationship_to_buyer1_spec.rb | 6 +++ .../buyer2_working_situation_spec.rb | 6 +++ .../sales/questions/gender_identity2_spec.rb | 6 +++ .../form/sales/questions/nationality1_spec.rb | 6 +++ .../questions/person_gender_identity_spec.rb | 48 +++++++++++++++++++ .../person_relationship_to_buyer1_spec.rb | 48 +++++++++++++++++++ .../person_working_situation_spec.rb | 48 +++++++++++++++++++ 16 files changed, 222 insertions(+) diff --git a/app/models/form/sales/questions/buyer1_working_situation.rb b/app/models/form/sales/questions/buyer1_working_situation.rb index d9c22ea03..79db1790b 100644 --- a/app/models/form/sales/questions/buyer1_working_situation.rb +++ b/app/models/form/sales/questions/buyer1_working_situation.rb @@ -8,6 +8,12 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it's a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @inferred_check_answers_value = [{ + "condition" => { + "ecstat1" => 10, + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb index a37605332..29d2fbe6b 100644 --- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb @@ -7,6 +7,12 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @inferred_check_answers_value = [{ + "condition" => { + "relat2" => "R", + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_working_situation.rb b/app/models/form/sales/questions/buyer2_working_situation.rb index cf1ca3940..21c68b456 100644 --- a/app/models/form/sales/questions/buyer2_working_situation.rb +++ b/app/models/form/sales/questions/buyer2_working_situation.rb @@ -7,6 +7,12 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @inferred_check_answers_value = [{ + "condition" => { + "ecstat2" => 10, + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/gender_identity2.rb b/app/models/form/sales/questions/gender_identity2.rb index 8783cc76c..e394ae325 100644 --- a/app/models/form/sales/questions/gender_identity2.rb +++ b/app/models/form/sales/questions/gender_identity2.rb @@ -7,6 +7,12 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @inferred_check_answers_value = [{ + "condition" => { + "sex2" => "R", + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/nationality1.rb b/app/models/form/sales/questions/nationality1.rb index 82a40df4e..53e9edc5f 100644 --- a/app/models/form/sales/questions/nationality1.rb +++ b/app/models/form/sales/questions/nationality1.rb @@ -18,6 +18,12 @@ class Form::Sales::Questions::Nationality1 < ::Form::Question ], } @check_answers_card_number = 1 + @inferred_check_answers_value = [{ + "condition" => { + "national" => 13, + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_gender_identity.rb b/app/models/form/sales/questions/person_gender_identity.rb index 71bebd818..d8bb7b41b 100644 --- a/app/models/form/sales/questions/person_gender_identity.rb +++ b/app/models/form/sales/questions/person_gender_identity.rb @@ -6,6 +6,12 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Sales::Questions::P @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = person_index + @inferred_check_answers_value = [{ + "condition" => { + id => "R", + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb index 72ee945f5..5b90e0049 100644 --- a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb +++ b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb @@ -6,6 +6,12 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Sales::Questi @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = person_index + @inferred_check_answers_value = [{ + "condition" => { + id => "R", + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_working_situation.rb b/app/models/form/sales/questions/person_working_situation.rb index 5393ce80d..c5c88a4ca 100644 --- a/app/models/form/sales/questions/person_working_situation.rb +++ b/app/models/form/sales/questions/person_working_situation.rb @@ -6,6 +6,12 @@ class Form::Sales::Questions::PersonWorkingSituation < ::Form::Sales::Questions: @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = person_index + @inferred_check_answers_value = [{ + "condition" => { + id => 10, + }, + "value" => "Prefers not to say", + }] end ANSWER_OPTIONS = { diff --git a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb index 1c6986aea..fdcc6ce36 100644 --- a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb @@ -49,4 +49,10 @@ RSpec.describe Form::Sales::Questions::Buyer1WorkingSituation, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat1" => 10 }, "value" => "Prefers not to say" }, + ]) + end end diff --git a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb index 059e5c084..4d0ebc861 100644 --- a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb @@ -47,4 +47,10 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat2" => "R" }, "value" => "Prefers not to say" }, + ]) + end end diff --git a/spec/models/form/sales/questions/buyer2_working_situation_spec.rb b/spec/models/form/sales/questions/buyer2_working_situation_spec.rb index 75b6fd7cb..7905f0df1 100644 --- a/spec/models/form/sales/questions/buyer2_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer2_working_situation_spec.rb @@ -54,4 +54,10 @@ RSpec.describe Form::Sales::Questions::Buyer2WorkingSituation, 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 inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat2" => 10 }, "value" => "Prefers not to say" }, + ]) + end end diff --git a/spec/models/form/sales/questions/gender_identity2_spec.rb b/spec/models/form/sales/questions/gender_identity2_spec.rb index ffd6ecc81..7c405afc6 100644 --- a/spec/models/form/sales/questions/gender_identity2_spec.rb +++ b/spec/models/form/sales/questions/gender_identity2_spec.rb @@ -43,4 +43,10 @@ RSpec.describe Form::Sales::Questions::GenderIdentity2, 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 inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex2" => "R" }, "value" => "Prefers not to say" }, + ]) + end end diff --git a/spec/models/form/sales/questions/nationality1_spec.rb b/spec/models/form/sales/questions/nationality1_spec.rb index 498386e5d..18f659e86 100644 --- a/spec/models/form/sales/questions/nationality1_spec.rb +++ b/spec/models/form/sales/questions/nationality1_spec.rb @@ -64,4 +64,10 @@ RSpec.describe Form::Sales::Questions::Nationality1, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "national" => 13 }, "value" => "Prefers not to say" }, + ]) + end end diff --git a/spec/models/form/sales/questions/person_gender_identity_spec.rb b/spec/models/form/sales/questions/person_gender_identity_spec.rb index fb828addf..036ce9af2 100644 --- a/spec/models/form/sales/questions/person_gender_identity_spec.rb +++ b/spec/models/form/sales/questions/person_gender_identity_spec.rb @@ -61,6 +61,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex2" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -86,6 +92,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex3" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end @@ -113,6 +125,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex3" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -138,6 +156,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex4" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end @@ -165,6 +189,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex4" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -190,6 +220,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex5" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end @@ -217,6 +253,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex5" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -242,6 +284,12 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(6) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "sex6" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end end diff --git a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb index 25124512e..e541efa10 100644 --- a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb @@ -61,6 +61,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat2" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -86,6 +92,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat3" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end @@ -113,6 +125,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat3" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -138,6 +156,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat4" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end @@ -165,6 +189,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat4" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -190,6 +220,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat5" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end @@ -217,6 +253,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat5" => "R" }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -242,6 +284,12 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(6) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "relat6" => "R" }, "value" => "Prefers not to say" }, + ]) + end end end end diff --git a/spec/models/form/sales/questions/person_working_situation_spec.rb b/spec/models/form/sales/questions/person_working_situation_spec.rb index a8beb49d1..a31325e25 100644 --- a/spec/models/form/sales/questions/person_working_situation_spec.rb +++ b/spec/models/form/sales/questions/person_working_situation_spec.rb @@ -68,6 +68,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat2" => 10 }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -93,6 +99,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat3" => 10 }, "value" => "Prefers not to say" }, + ]) + end end end @@ -120,6 +132,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat3" => 10 }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -145,6 +163,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat4" => 10 }, "value" => "Prefers not to say" }, + ]) + end end end @@ -172,6 +196,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat4" => 10 }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -197,6 +227,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat5" => 10 }, "value" => "Prefers not to say" }, + ]) + end end end @@ -224,6 +260,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat5" => 10 }, "value" => "Prefers not to say" }, + ]) + end end context "and joint purchase" do @@ -249,6 +291,12 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(6) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to eq([ + { "condition" => { "ecstat6" => 10 }, "value" => "Prefers not to say" }, + ]) + end end end end