diff --git a/app/models/form/sales/pages/extra_borrowing.rb b/app/models/form/sales/pages/extra_borrowing.rb index 7fb8b08a4..c7cc6a2f0 100644 --- a/app/models/form/sales/pages/extra_borrowing.rb +++ b/app/models/form/sales/pages/extra_borrowing.rb @@ -1,17 +1,18 @@ class Form::Sales::Pages::ExtraBorrowing < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, question_number) + super(id, hsh, subsection) @header = "" @description = "" @subsection = subsection @depends_on = [{ "mortgageused" => 1, }] + @question_number = question_number end def questions @questions ||= [ - Form::Sales::Questions::ExtraBorrowing.new(nil, nil, self), + Form::Sales::Questions::ExtraBorrowing.new(nil, nil, self, question_number: @question_number), ] end end diff --git a/app/models/form/sales/pages/living_before_purchase.rb b/app/models/form/sales/pages/living_before_purchase.rb index ac61ab1de..5841bcc1d 100644 --- a/app/models/form/sales/pages/living_before_purchase.rb +++ b/app/models/form/sales/pages/living_before_purchase.rb @@ -1,4 +1,9 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page + def initialize(id, hsh, form, question_number:) + super(id, hsh, form) + @question_number = question_number + end + def questions @questions ||= [ living_before_purchase, @@ -8,7 +13,7 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page def living_before_purchase if form.start_date.year >= 2023 - Form::Sales::Questions::LivingBeforePurchase.new(nil, nil, self) + Form::Sales::Questions::LivingBeforePurchase.new(nil, nil, self, question_number: @question_number) end end end diff --git a/app/models/form/sales/pages/mortgage_amount.rb b/app/models/form/sales/pages/mortgage_amount.rb index 153c3bbe6..7f1ae59b9 100644 --- a/app/models/form/sales/pages/mortgage_amount.rb +++ b/app/models/form/sales/pages/mortgage_amount.rb @@ -1,15 +1,16 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, question_number) + super(id, hsh, subsection) @header = "Mortgage Amount" @depends_on = [{ "mortgageused" => 1, }] + @question_number = question_number end def questions @questions ||= [ - Form::Sales::Questions::MortgageAmount.new(nil, nil, self), + Form::Sales::Questions::MortgageAmount.new(nil, nil, self, question_number: @question_number), ] end end diff --git a/app/models/form/sales/pages/mortgage_lender.rb b/app/models/form/sales/pages/mortgage_lender.rb index 552d7abf8..ada624b52 100644 --- a/app/models/form/sales/pages/mortgage_lender.rb +++ b/app/models/form/sales/pages/mortgage_lender.rb @@ -1,17 +1,18 @@ class Form::Sales::Pages::MortgageLender < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, question_number) + super(id, hsh, subsection) @header = "" @description = "" @subsection = subsection @depends_on = [{ "mortgageused" => 1, }] + @question_number = question_number end def questions @questions ||= [ - Form::Sales::Questions::MortgageLender.new(nil, nil, self), + Form::Sales::Questions::MortgageLender.new(nil, nil, self, question_number: @question_number), ] end end diff --git a/app/models/form/sales/pages/mortgage_length.rb b/app/models/form/sales/pages/mortgage_length.rb index 979369bdd..fe1bb54bf 100644 --- a/app/models/form/sales/pages/mortgage_length.rb +++ b/app/models/form/sales/pages/mortgage_length.rb @@ -1,14 +1,15 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, question_number:) + super(id, hsh, subsection) @depends_on = [{ "mortgageused" => 1, }] + @question_number = question_number end def questions @questions ||= [ - Form::Sales::Questions::MortgageLength.new(nil, nil, self), + Form::Sales::Questions::MortgageLength.new(nil, nil, self, question_number: @question_number), ] end end diff --git a/app/models/form/sales/pages/mortgageused.rb b/app/models/form/sales/pages/mortgageused.rb index 4a22c480e..bd506600c 100644 --- a/app/models/form/sales/pages/mortgageused.rb +++ b/app/models/form/sales/pages/mortgageused.rb @@ -1,7 +1,12 @@ class Form::Sales::Pages::Mortgageused < ::Form::Page + def initialize(id, hsh, form, question_number:) + super(id, hsh, form) + @question_number = question_number + end + def questions @questions ||= [ - Form::Sales::Questions::Mortgageused.new(nil, nil, self), + Form::Sales::Questions::Mortgageused.new(nil, nil, self, question_number: @question_number), ] end end diff --git a/app/models/form/sales/questions/extra_borrowing.rb b/app/models/form/sales/questions/extra_borrowing.rb index 04f906b22..93afbe823 100644 --- a/app/models/form/sales/questions/extra_borrowing.rb +++ b/app/models/form/sales/questions/extra_borrowing.rb @@ -1,9 +1,9 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, question_number:) + super(id, hsh, page) @id = "extrabor" @check_answer_label = "Any other borrowing?" - @header = "Does this include any extra borrowing?" + @header = "#{question_number} - Does this include any extra borrowing?" @type = "radio" @answer_options = ANSWER_OPTIONS @page = page diff --git a/app/models/form/sales/questions/living_before_purchase.rb b/app/models/form/sales/questions/living_before_purchase.rb index f631220dc..ba5619328 100644 --- a/app/models/form/sales/questions/living_before_purchase.rb +++ b/app/models/form/sales/questions/living_before_purchase.rb @@ -1,9 +1,9 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, question_number:) + super(id, hsh, page) @id = "proplen_asked" @check_answer_label = "Buyer lived in the property before purchasing" - @header = "Did the buyer live in the property before purchasing it?" + @header = "#{question_number} - Did the buyer live in the property before purchasing it?" @hint_text = nil @type = "radio" @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/mortgage_amount.rb b/app/models/form/sales/questions/mortgage_amount.rb index bd4ae5e60..87bcb2d4a 100644 --- a/app/models/form/sales/questions/mortgage_amount.rb +++ b/app/models/form/sales/questions/mortgage_amount.rb @@ -1,9 +1,9 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, question_number:) + super(id, hsh, page) @id = "mortgage" @check_answer_label = "Mortgage amount" - @header = "What is the mortgage amount?" + @header = "#{question_number} - What is the mortgage amount?" @type = "numeric" @min = 0 @width = 5 diff --git a/app/models/form/sales/questions/mortgage_lender.rb b/app/models/form/sales/questions/mortgage_lender.rb index 54c9a66c6..0e9c580b4 100644 --- a/app/models/form/sales/questions/mortgage_lender.rb +++ b/app/models/form/sales/questions/mortgage_lender.rb @@ -1,9 +1,9 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, question_number:) + super(id, hsh, page) @id = "mortgagelender" @check_answer_label = "Mortgage Lender" - @header = "What is the name of the mortgage lender?" + @header = "#{question_number} - What is the name of the mortgage lender?" @type = "select" @hint_text = "" @page = page diff --git a/app/models/form/sales/questions/mortgage_length.rb b/app/models/form/sales/questions/mortgage_length.rb index 3f1603b75..585a573fb 100644 --- a/app/models/form/sales/questions/mortgage_length.rb +++ b/app/models/form/sales/questions/mortgage_length.rb @@ -1,9 +1,9 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, question_number:) + super(id, hsh, page) @id = "mortlen" @check_answer_label = "Length of mortgage" - @header = "What is the length of the mortgage?" + @header = "#{question_number} - What is the length of the mortgage?" @type = "numeric" @min = 0 @max = 60 diff --git a/app/models/form/sales/questions/mortgageused.rb b/app/models/form/sales/questions/mortgageused.rb index 8c75750d8..13120704a 100644 --- a/app/models/form/sales/questions/mortgageused.rb +++ b/app/models/form/sales/questions/mortgageused.rb @@ -1,9 +1,9 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, question_number:) + super(id, hsh, page) @id = "mortgageused" @check_answer_label = "Mortgage used" - @header = "Was a mortgage used for the purchase of this property?" + @header = "#{question_number} - Was a mortgage used for the purchase of this property?" @type = "radio" @answer_options = ANSWER_OPTIONS end diff --git a/app/models/form/sales/subsections/discounted_ownership_scheme.rb b/app/models/form/sales/subsections/discounted_ownership_scheme.rb index a44f10ee9..f277fc5ec 100644 --- a/app/models/form/sales/subsections/discounted_ownership_scheme.rb +++ b/app/models/form/sales/subsections/discounted_ownership_scheme.rb @@ -8,7 +8,7 @@ class Form::Sales::Subsections::DiscountedOwnershipScheme < ::Form::Subsection def pages @pages ||= [ - Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_discounted_ownership", nil, self), + Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_discounted_ownership", nil, self, question_number: "Q99"), Form::Sales::Pages::AboutPriceRtb.new(nil, nil, self), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_price_value_check", nil, self), Form::Sales::Pages::AboutPriceNotRtb.new(nil, nil, self), @@ -16,16 +16,16 @@ class Form::Sales::Subsections::DiscountedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_ownership", nil, self), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_discounted_ownership_value_check", nil, self), Form::Sales::Pages::DepositAndMortgageValueCheck.new("discounted_ownership_deposit_and_mortgage_value_check_after_value_and_discount", nil, self), - Form::Sales::Pages::Mortgageused.new("mortgage_used_discounted_ownership", nil, self), + Form::Sales::Pages::Mortgageused.new("mortgage_used_discounted_ownership", nil, self, question_number: "Q103"), Form::Sales::Pages::MortgageValueCheck.new("discounted_ownership_mortgage_used_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageAmount.new("mortgage_amount_discounted_ownership", nil, self), + Form::Sales::Pages::MortgageAmount.new("mortgage_amount_discounted_ownership", nil, self, question_number: "Q104"), Form::Sales::Pages::MortgageValueCheck.new("discounted_ownership_mortgage_amount_mortgage_value_check", nil, self), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_mortgage_value_check", nil, self), Form::Sales::Pages::DepositAndMortgageValueCheck.new("discounted_ownership_deposit_and_mortgage_value_check_after_mortgage", nil, self), - Form::Sales::Pages::MortgageLender.new("mortgage_lender_discounted_ownership", nil, self), + Form::Sales::Pages::MortgageLender.new("mortgage_lender_discounted_ownership", nil, self, question_number: "Q105"), Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_discounted_ownership", nil, self), - Form::Sales::Pages::MortgageLength.new("mortgage_length_discounted_ownership", nil, self), - Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_discounted_ownership", nil, self), + Form::Sales::Pages::MortgageLength.new("mortgage_length_discounted_ownership", nil, self, question_number: "Q106"), + Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_discounted_ownership", nil, self, question_number: "Q107"), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_value_check", nil, self), Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_discounted_ownership", nil, self), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_deposit_value_check", nil, self), diff --git a/app/models/form/sales/subsections/outright_sale.rb b/app/models/form/sales/subsections/outright_sale.rb index 256c1c8dc..8e80e13df 100644 --- a/app/models/form/sales/subsections/outright_sale.rb +++ b/app/models/form/sales/subsections/outright_sale.rb @@ -10,14 +10,14 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection @pages ||= [ Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_sale", nil, self), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_outright_sale_value_check", nil, self), - Form::Sales::Pages::Mortgageused.new("mortgage_used_outright_sale", nil, self), + Form::Sales::Pages::Mortgageused.new("mortgage_used_outright_sale", nil, self, question_number: "Q111"), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self), + Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self, question_number: "Q112"), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_amount_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self), + Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, question_number: "Q113"), Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self), - Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self), - Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self), + Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self, question_number: "Q114"), + Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self, question_number: "Q115"), Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_outright_sale", nil, self), Form::Sales::Pages::DepositValueCheck.new("outright_sale_deposit_value_check", nil, self), Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_outright_sale", nil, self), diff --git a/app/models/form/sales/subsections/shared_ownership_scheme.rb b/app/models/form/sales/subsections/shared_ownership_scheme.rb index 1f0cd6450..f4e7129ab 100644 --- a/app/models/form/sales/subsections/shared_ownership_scheme.rb +++ b/app/models/form/sales/subsections/shared_ownership_scheme.rb @@ -8,7 +8,7 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection def pages @pages ||= [ - Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_shared_ownership", nil, self), + Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_shared_ownership", nil, self, question_number: "Q75"), Form::Sales::Pages::Staircase.new(nil, nil, self), Form::Sales::Pages::AboutStaircase.new(nil, nil, self), Form::Sales::Pages::StaircaseBoughtValueCheck.new(nil, nil, self), @@ -24,15 +24,15 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::AboutPriceSharedOwnership.new(nil, nil, self), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_shared_ownership_value_check", nil, self), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_equity_value_check", nil, self), - Form::Sales::Pages::Mortgageused.new("mortgage_used_shared_ownership", nil, self), + Form::Sales::Pages::Mortgageused.new("mortgage_used_shared_ownership", nil, self, question_number: "Q90"), Form::Sales::Pages::MortgageValueCheck.new("mortgage_used_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageAmount.new("mortgage_amount_shared_ownership", nil, self), + Form::Sales::Pages::MortgageAmount.new("mortgage_amount_shared_ownership", nil, self, question_number: "Q91"), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_mortgage_amount_value_check", nil, self), Form::Sales::Pages::MortgageValueCheck.new("mortgage_amount_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageLender.new("mortgage_lender_shared_ownership", nil, self), + Form::Sales::Pages::MortgageLender.new("mortgage_lender_shared_ownership", nil, self, question_number: "Q92"), Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_shared_ownership", nil, self), - Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self), - Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self), + Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, question_number: "Q93"), + Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, question_number: "Q94"), Form::Sales::Pages::AboutDepositWithDiscount.new(nil, nil, self), Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_shared_ownership", nil, self), Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self), diff --git a/spec/models/form/sales/pages/extra_borrowing_spec.rb b/spec/models/form/sales/pages/extra_borrowing_spec.rb index 5540f89cf..60bd3c288 100644 --- a/spec/models/form/sales/pages/extra_borrowing_spec.rb +++ b/spec/models/form/sales/pages/extra_borrowing_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::ExtraBorrowing, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, question_number:) } let(:page_id) { nil } let(:page_definition) { nil } + let(:question_number) { "Q96" } let(:subsection) { instance_double(Form::Subsection) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/living_before_purchase_spec.rb b/spec/models/form/sales/pages/living_before_purchase_spec.rb index 76dbd7609..f0dea8e05 100644 --- a/spec/models/form/sales/pages/living_before_purchase_spec.rb +++ b/spec/models/form/sales/pages/living_before_purchase_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::LivingBeforePurchase, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, question_number:) } let(:page_id) { nil } let(:page_definition) { nil } + let(:question_number) { "Q99" } let(:subsection) { instance_double(Form::Subsection) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/mortgage_amount_spec.rb b/spec/models/form/sales/pages/mortgage_amount_spec.rb index 1aa563d9b..3ef687a8f 100644 --- a/spec/models/form/sales/pages/mortgage_amount_spec.rb +++ b/spec/models/form/sales/pages/mortgage_amount_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageAmount, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, question_number:) } let(:page_id) { nil } let(:page_definition) { nil } + let(:question_number) { "Q44" } let(:subsection) { instance_double(Form::Subsection) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/mortgage_lender_spec.rb b/spec/models/form/sales/pages/mortgage_lender_spec.rb index fafa8e043..f44292e69 100644 --- a/spec/models/form/sales/pages/mortgage_lender_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageLender, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, question_number:) } let(:page_id) { "mortgage_lender" } let(:page_definition) { nil } + let(:question_number) { "Q34" } let(:subsection) { instance_double(Form::Subsection) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/mortgage_length_spec.rb b/spec/models/form/sales/pages/mortgage_length_spec.rb index ef2573e57..62f1b2a0a 100644 --- a/spec/models/form/sales/pages/mortgage_length_spec.rb +++ b/spec/models/form/sales/pages/mortgage_length_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageLength, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, question_number:) } let(:page_id) { nil } let(:page_definition) { nil } + let(:question_number) { "Q99" } let(:subsection) { instance_double(Form::Subsection) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/mortgageused_spec.rb b/spec/models/form/sales/pages/mortgageused_spec.rb index 963814074..3a9254431 100644 --- a/spec/models/form/sales/pages/mortgageused_spec.rb +++ b/spec/models/form/sales/pages/mortgageused_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::Mortgageused, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, question_number:) } let(:page_id) { "mortgage_used" } let(:page_definition) { nil } + let(:question_number) { "Q98" } let(:subsection) { instance_double(Form::Subsection) } it "has correct subsection" do diff --git a/spec/models/form/sales/questions/extra_borrowing_spec.rb b/spec/models/form/sales/questions/extra_borrowing_spec.rb index b9149c27d..460d0563c 100644 --- a/spec/models/form/sales/questions/extra_borrowing_spec.rb +++ b/spec/models/form/sales/questions/extra_borrowing_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, question_number:) } let(:question_id) { nil } let(:question_definition) { nil } + let(:question_number) { "Q96" } let(:page) { instance_double(Form::Page) } it "has correct page" do @@ -16,7 +17,7 @@ RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do end it "has the correct header" do - expect(question.header).to eq("Does this include any extra borrowing?") + expect(question.header).to eq("Q96 - Does this include any extra borrowing?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/living_before_purchase_spec.rb b/spec/models/form/sales/questions/living_before_purchase_spec.rb index 530bb151a..d80875d4c 100644 --- a/spec/models/form/sales/questions/living_before_purchase_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, question_number:) } let(:question_id) { nil } let(:question_definition) { nil } + let(:question_number) { "Q99" } let(:page) { instance_double(Form::Page) } it "has correct page" do @@ -16,7 +17,7 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do end it "has the correct header" do - expect(question.header).to eq("Did the buyer live in the property before purchasing it?") + expect(question.header).to eq("Q99 - Did the buyer live in the property before purchasing it?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/mortgage_amount_spec.rb b/spec/models/form/sales/questions/mortgage_amount_spec.rb index 832b47d37..93057f390 100644 --- a/spec/models/form/sales/questions/mortgage_amount_spec.rb +++ b/spec/models/form/sales/questions/mortgage_amount_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, question_number:) } let(:question_id) { nil } let(:question_definition) { nil } + let(:question_number) { "Q34" } let(:page) { instance_double(Form::Page) } it "has correct page" do @@ -16,7 +17,7 @@ RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do end it "has the correct header" do - expect(question.header).to eq("What is the mortgage amount?") + expect(question.header).to eq("Q34 - What is the mortgage amount?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/mortgage_lender_spec.rb b/spec/models/form/sales/questions/mortgage_lender_spec.rb index 659cf7070..2c8427893 100644 --- a/spec/models/form/sales/questions/mortgage_lender_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, question_number:) } let(:question_id) { nil } let(:question_definition) { nil } + let(:question_number) { "Q1" } let(:page) { instance_double(Form::Page) } it "has correct page" do @@ -16,7 +17,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do end it "has the correct header" do - expect(question.header).to eq("What is the name of the mortgage lender?") + expect(question.header).to eq("Q1 - What is the name of the mortgage lender?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/mortgage_length_spec.rb b/spec/models/form/sales/questions/mortgage_length_spec.rb index 0f3193244..ce82e424c 100644 --- a/spec/models/form/sales/questions/mortgage_length_spec.rb +++ b/spec/models/form/sales/questions/mortgage_length_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, question_number:) } let(:question_id) { nil } let(:question_definition) { nil } + let(:question_number) { "Q96" } let(:page) { instance_double(Form::Page) } it "has correct page" do @@ -16,7 +17,7 @@ RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do end it "has the correct header" do - expect(question.header).to eq("What is the length of the mortgage?") + expect(question.header).to eq("Q96 - What is the length of the mortgage?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/mortgageused_spec.rb b/spec/models/form/sales/questions/mortgageused_spec.rb index e958de8ea..82dbd3e4f 100644 --- a/spec/models/form/sales/questions/mortgageused_spec.rb +++ b/spec/models/form/sales/questions/mortgageused_spec.rb @@ -1,10 +1,11 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, question_number:) } let(:question_id) { nil } let(:question_definition) { nil } + let(:question_number) { "Q91" } let(:page) { instance_double(Form::Page) } it "has correct page" do @@ -16,7 +17,7 @@ RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do end it "has the correct header" do - expect(question.header).to eq("Was a mortgage used for the purchase of this property?") + expect(question.header).to eq("Q91 - Was a mortgage used for the purchase of this property?") end it "has the correct check_answer_label" do