diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb index 20e9f70ee..debb14a03 100644 --- a/app/models/form/lettings/questions/person_relationship.rb +++ b/app/models/form/lettings/questions/person_relationship.rb @@ -3,7 +3,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question super(id, hsh, page) @id = "relat#{person_index}" @check_answer_label = "Person #{person_index}’s relationship to the lead tenant" - @header = "#{question_number(person_index)} - What is person #{person_index}’s relationship to the lead tenant?" + @header = "What is person #{person_index}’s relationship to the lead tenant?" @type = "radio" @check_answers_card_number = person_index @hint_text = "" @@ -20,19 +20,4 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" }, }.freeze - - def question_number(person_index) - case person_index - when 2 - "Q36" - when 3 - "Q40" - when 4 - "Q44" - when 5 - "Q48" - when 6 - "Q52" - end - end end 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 774de4208..b7a4478f4 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 @@ -2,7 +2,7 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @check_answer_label = "Person #{person_index}’s relationship to Buyer 1" - @header = "What is Person #{person_index}’s relationship to Buyer 1?" + @header = "#{question_number(person_index)} - What is Person #{person_index}’s relationship to Buyer 1?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = person_index @@ -20,4 +20,19 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question "X" => { "value" => "Other" }, "R" => { "value" => "Person prefers not to say" }, }.freeze + + def question_number(person_index) + case person_index + when 2 + "Q36" + when 3 + "Q40" + when 4 + "Q44" + when 5 + "Q48" + when 6 + "Q52" + 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 424d82498..376c884bc 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 @@ -42,7 +42,7 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model end it "has the correct header" do - expect(question.header).to eq("What is Person 2’s relationship to Buyer 1?") + expect(question.header).to eq("Q36 - What is Person 2’s relationship to Buyer 1?") end it "has the correct check_answer_label" do @@ -69,7 +69,7 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model end it "has the correct header" do - expect(question.header).to eq("What is Person 3’s relationship to Buyer 1?") + expect(question.header).to eq("Q40 - What is Person 3’s relationship to Buyer 1?") end it "has the correct check_answer_label" do @@ -96,7 +96,7 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model end it "has the correct header" do - expect(question.header).to eq("What is Person 4’s relationship to Buyer 1?") + expect(question.header).to eq("Q44 - What is Person 4’s relationship to Buyer 1?") end it "has the correct check_answer_label" do @@ -123,7 +123,7 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model end it "has the correct header" do - expect(question.header).to eq("What is Person 5’s relationship to Buyer 1?") + expect(question.header).to eq("Q48 - What is Person 5’s relationship to Buyer 1?") end it "has the correct check_answer_label" do