Browse Source

Number mortgage questions

CLDC-1864-question-numbering
Kat 2 years ago
parent
commit
8a103ae6b0
  1. 7
      app/models/form/sales/pages/extra_borrowing.rb
  2. 7
      app/models/form/sales/pages/living_before_purchase.rb
  3. 7
      app/models/form/sales/pages/mortgage_amount.rb
  4. 7
      app/models/form/sales/pages/mortgage_lender.rb
  5. 7
      app/models/form/sales/pages/mortgage_length.rb
  6. 7
      app/models/form/sales/pages/mortgageused.rb
  7. 6
      app/models/form/sales/questions/extra_borrowing.rb
  8. 6
      app/models/form/sales/questions/living_before_purchase.rb
  9. 6
      app/models/form/sales/questions/mortgage_amount.rb
  10. 6
      app/models/form/sales/questions/mortgage_lender.rb
  11. 6
      app/models/form/sales/questions/mortgage_length.rb
  12. 6
      app/models/form/sales/questions/mortgageused.rb
  13. 12
      app/models/form/sales/subsections/discounted_ownership_scheme.rb
  14. 10
      app/models/form/sales/subsections/outright_sale.rb
  15. 12
      app/models/form/sales/subsections/shared_ownership_scheme.rb
  16. 3
      spec/models/form/sales/pages/extra_borrowing_spec.rb
  17. 3
      spec/models/form/sales/pages/living_before_purchase_spec.rb
  18. 3
      spec/models/form/sales/pages/mortgage_amount_spec.rb
  19. 3
      spec/models/form/sales/pages/mortgage_lender_spec.rb
  20. 3
      spec/models/form/sales/pages/mortgage_length_spec.rb
  21. 3
      spec/models/form/sales/pages/mortgageused_spec.rb
  22. 5
      spec/models/form/sales/questions/extra_borrowing_spec.rb
  23. 5
      spec/models/form/sales/questions/living_before_purchase_spec.rb
  24. 5
      spec/models/form/sales/questions/mortgage_amount_spec.rb
  25. 5
      spec/models/form/sales/questions/mortgage_lender_spec.rb
  26. 5
      spec/models/form/sales/questions/mortgage_length_spec.rb
  27. 5
      spec/models/form/sales/questions/mortgageused_spec.rb

7
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

7
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

7
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

7
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

7
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

7
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

6
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

6
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

6
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

6
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

6
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

6
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

12
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),

10
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),

12
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),

3
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

3
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

3
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

3
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

3
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

3
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

5
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

5
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

5
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

5
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

5
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

5
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

Loading…
Cancel
Save