Browse Source

Make relationship questions generic

pull/1254/head
Kat 3 years ago
parent
commit
9272b6b567
  1. 13
      app/models/form/lettings/pages/person_2_relationship_to_lead.rb
  2. 13
      app/models/form/lettings/pages/person_3_relationship_to_lead.rb
  3. 13
      app/models/form/lettings/pages/person_4_relationship_to_lead.rb
  4. 13
      app/models/form/lettings/pages/person_5_relationship_to_lead.rb
  5. 13
      app/models/form/lettings/pages/person_6_relationship_to_lead.rb
  6. 13
      app/models/form/lettings/pages/person_7_relationship_to_lead.rb
  7. 13
      app/models/form/lettings/pages/person_8_relationship_to_lead.rb
  8. 14
      app/models/form/lettings/pages/person_relationship_to_lead.rb
  9. 14
      app/models/form/lettings/questions/person_relationship.rb
  10. 14
      app/models/form/lettings/questions/relat3.rb
  11. 14
      app/models/form/lettings/questions/relat4.rb
  12. 14
      app/models/form/lettings/questions/relat5.rb
  13. 14
      app/models/form/lettings/questions/relat6.rb
  14. 14
      app/models/form/lettings/questions/relat7.rb
  15. 14
      app/models/form/lettings/questions/relat8.rb
  16. 14
      app/models/form/lettings/subsections/household_characteristics.rb
  17. 55
      spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb
  18. 79
      spec/models/form/lettings/questions/person_relationship_spec.rb

13
app/models/form/lettings/pages/person_2_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person2RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_2_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_2" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat2.new(nil, nil, self)]
end
end

13
app/models/form/lettings/pages/person_3_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person3RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_3_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_3" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat3.new(nil, nil, self)]
end
end

13
app/models/form/lettings/pages/person_4_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person4RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_4_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_4" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat4.new(nil, nil, self)]
end
end

13
app/models/form/lettings/pages/person_5_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person5RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_5_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_5" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat5.new(nil, nil, self)]
end
end

13
app/models/form/lettings/pages/person_6_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person6RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_6_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_6" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat6.new(nil, nil, self)]
end
end

13
app/models/form/lettings/pages/person_7_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person7RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_7_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_7" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat7.new(nil, nil, self)]
end
end

13
app/models/form/lettings/pages/person_8_relationship_to_lead.rb

@ -1,13 +0,0 @@
class Form::Lettings::Pages::Person8RelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "person_8_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_8" => 0 }]
@description = ""
end
def questions
@questions ||= [Form::Lettings::Questions::Relat8.new(nil, nil, self)]
end
end

14
app/models/form/lettings/pages/person_relationship_to_lead.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::PersonRelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_relationship_to_lead"
@header = ""
@depends_on = [{ "details_known_#{person_index}" => 0 }]
@description = ""
@person_index = person_index
end
def questions
@questions ||= [Form::Lettings::Questions::PersonRelationship.new(nil, nil, self, person_index: @person_index)]
end
end

14
app/models/form/lettings/questions/relat2.rb → app/models/form/lettings/questions/person_relationship.rb

@ -1,11 +1,11 @@
class Form::Lettings::Questions::Relat2 < ::Form::Question class Form::Lettings::Questions::PersonRelationship < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page, person_index:)
super super(id, hsh, page)
@id = "relat2" @id = "relat#{person_index}"
@check_answer_label = "Person 2’s relationship to the lead tenant" @check_answer_label = "Person #{person_index}’s relationship to the lead tenant"
@header = "What is person 2’s relationship to the lead tenant?" @header = "What is person #{person_index}’s relationship to the lead tenant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 2 @check_answers_card_number = person_index
@hint_text = "" @hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
end end

14
app/models/form/lettings/questions/relat3.rb

@ -1,14 +0,0 @@
class Form::Lettings::Questions::Relat3 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat3"
@check_answer_label = "Person 3’s relationship to the lead tenant"
@header = "What is person 3’s relationship to the lead tenant?"
@type = "radio"
@check_answers_card_number = 3
@hint_text = ""
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = { "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" } }.freeze
end

14
app/models/form/lettings/questions/relat4.rb

@ -1,14 +0,0 @@
class Form::Lettings::Questions::Relat4 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat4"
@check_answer_label = "Person 4’s relationship to the lead tenant"
@header = "What is person 4’s relationship to the lead tenant?"
@type = "radio"
@check_answers_card_number = 4
@hint_text = ""
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = { "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" } }.freeze
end

14
app/models/form/lettings/questions/relat5.rb

@ -1,14 +0,0 @@
class Form::Lettings::Questions::Relat5 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat5"
@check_answer_label = "Person 5’s relationship to the lead tenant"
@header = "What is person 5’s relationship to the lead tenant?"
@type = "radio"
@check_answers_card_number = 5
@hint_text = ""
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = { "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" } }.freeze
end

14
app/models/form/lettings/questions/relat6.rb

@ -1,14 +0,0 @@
class Form::Lettings::Questions::Relat6 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat6"
@check_answer_label = "Person 6’s relationship to the lead tenant"
@header = "What is person 6’s relationship to the lead tenant?"
@type = "radio"
@check_answers_card_number = 6
@hint_text = ""
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = { "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" } }.freeze
end

14
app/models/form/lettings/questions/relat7.rb

@ -1,14 +0,0 @@
class Form::Lettings::Questions::Relat7 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat7"
@check_answer_label = "Person 7’s relationship to the lead tenant"
@header = "What is person 7’s relationship to the lead tenant?"
@type = "radio"
@check_answers_card_number = 7
@hint_text = ""
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = { "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" } }.freeze
end

14
app/models/form/lettings/questions/relat8.rb

@ -1,14 +0,0 @@
class Form::Lettings::Questions::Relat8 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat8"
@check_answer_label = "Person 8’s relationship to the lead tenant"
@header = "What is person 8’s relationship to the lead tenant?"
@type = "radio"
@check_answers_card_number = 8
@hint_text = ""
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = { "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" } }.freeze
end

14
app/models/form/lettings/subsections/household_characteristics.rb

@ -28,7 +28,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::Person2RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson2AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson2AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson2AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson2AgeValueCheck.new(nil, nil, self),
@ -39,7 +39,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::Person2UnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person2UnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Person2OverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person2OverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::Person3RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson3AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson3AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson3AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson3AgeValueCheck.new(nil, nil, self),
@ -50,7 +50,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::Person3UnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person3UnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Person3OverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person3OverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::Person4RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson4AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson4AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson4AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson4AgeValueCheck.new(nil, nil, self),
@ -61,7 +61,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::Person4UnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person4UnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Person4OverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person4OverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::Person5RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson5AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson5AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson5AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson5AgeValueCheck.new(nil, nil, self),
@ -72,7 +72,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::Person5UnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person5UnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Person5OverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person5OverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::Person6RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson6AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson6AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson6AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson6AgeValueCheck.new(nil, nil, self),
@ -83,7 +83,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::Person6UnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person6UnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Person6OverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person6OverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::Person7RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson7AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson7AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson7AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson7AgeValueCheck.new(nil, nil, self),
@ -94,7 +94,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::Person7UnderRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person7UnderRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Person7OverRetirementValueCheck.new(nil, nil, self), Form::Lettings::Pages::Person7OverRetirementValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::Person8RelationshipToLead.new(nil, nil, self), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson8AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdPerson8AgeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson8AgeValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPerson8AgeValueCheck.new(nil, nil, self),

55
spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb

@ -0,0 +1,55 @@
require "rails_helper"
RSpec.describe Form::Lettings::Pages::PersonRelationshipToLead, type: :model do
subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
let(:person_index) { 2 }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has the correct header" do
expect(page.header).to eq("")
end
it "has the correct description" do
expect(page.description).to eq("")
end
context "with person 2" do
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[relat2])
end
it "has the correct id" do
expect(page.id).to eq("person_2_relationship_to_lead")
end
it "has correct depends_on" do
expect(page.depends_on).to eq(
[{ "details_known_2" => 0 }],
)
end
end
context "with person 3" do
let(:person_index) { 3 }
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[relat3])
end
it "has the correct id" do
expect(page.id).to eq("person_3_relationship_to_lead")
end
it "has correct depends_on" do
expect(page.depends_on).to eq(
[{ "details_known_3" => 0 }],
)
end
end
end

79
spec/models/form/lettings/questions/person_relationship_spec.rb

@ -0,0 +1,79 @@
require "rails_helper"
RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do
subject(:question) { described_class.new(nil, question_definition, page, person_index:) }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
let(:person_index) { 2 }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct type" do
expect(question.type).to eq("radio")
end
it "is not marked as derived" do
expect(question.derived?).to be false
end
it "has the correct answer_options" do
expect(question.answer_options).to eq("C" => { "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education.", "value" => "Child" },
"P" => { "value" => "Partner" },
"R" => { "value" => "Person prefers not to say" },
"X" => { "value" => "Other" },
"divider" => { "value" => true })
end
it "has the correct hint" do
expect(question.hint_text).to eq("")
end
it "has correct conditional for" do
expect(question.conditional_for).to be nil
end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to be nil
end
context "with person 2" do
it "has the correct id" do
expect(question.id).to eq("relat2")
end
it "has the correct header" do
expect(question.header).to eq("What is person 2’s relationship to the lead tenant?")
end
it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(2)
end
it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Person 2’s relationship to the lead tenant")
end
end
context "with person 3" do
let(:person_index) { 3 }
it "has the correct id" do
expect(question.id).to eq("relat3")
end
it "has the correct header" do
expect(question.header).to eq("What is person 3’s relationship to the lead tenant?")
end
it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(3)
end
it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Person 3’s relationship to the lead tenant")
end
end
end
Loading…
Cancel
Save