Browse Source

Refactor sales income and benefits soft validations

pull/2709/head
Kat 2 years ago
parent
commit
74c875fb06
  1. 3
      app/models/form/sales/pages/buyer1_income_max_value_check.rb
  2. 5
      app/models/form/sales/pages/buyer1_income_min_value_check.rb
  3. 3
      app/models/form/sales/pages/buyer2_income_max_value_check.rb
  4. 5
      app/models/form/sales/pages/buyer2_income_min_value_check.rb
  5. 3
      app/models/form/sales/pages/combined_income_max_value_check.rb
  6. 5
      app/models/form/sales/pages/deposit_value_check.rb
  7. 6
      app/models/form/sales/pages/mortgage_value_check.rb
  8. 5
      app/models/form/sales/pages/savings_value_check.rb
  9. 3
      app/models/form/sales/questions/buyer1_income_value_check.rb
  10. 3
      app/models/form/sales/questions/buyer2_income_value_check.rb
  11. 3
      app/models/form/sales/questions/combined_income_value_check.rb
  12. 3
      app/models/form/sales/questions/deposit_value_check.rb
  13. 3
      app/models/form/sales/questions/mortgage_value_check.rb
  14. 3
      app/models/form/sales/questions/savings_value_check.rb
  15. 20
      config/locales/en.yml
  16. 60
      config/locales/forms/2023/sales/soft_validations.en.yml
  17. 60
      config/locales/forms/2024/sales/soft_validations.en.yml
  18. 3
      spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb
  19. 3
      spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb
  20. 3
      spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb
  21. 3
      spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb
  22. 3
      spec/models/form/sales/pages/combined_income_max_value_check_spec.rb
  23. 3
      spec/models/form/sales/pages/deposit_value_check_spec.rb
  24. 3
      spec/models/form/sales/pages/mortgage_value_check_spec.rb
  25. 3
      spec/models/form/sales/pages/savings_value_check_spec.rb

3
app/models/form/sales/pages/buyer1_income_max_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::Buyer1IncomeMaxValueCheck < ::Form::Page
"income1_over_soft_max?" => true, "income1_over_soft_max?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.income1_value_check.max"
@title_text = { @title_text = {
"translation" => "soft_validations.income.over_soft_max_for_la_buyer_1", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",

5
app/models/form/sales/pages/buyer1_income_min_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::Buyer1IncomeMinValueCheck < ::Form::Page
"income1_under_soft_min?" => true, "income1_under_soft_min?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.income1_value_check.min"
@title_text = { @title_text = {
"translation" => "soft_validations.income.under_soft_min_for_economic_status.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
@ -22,7 +23,7 @@ class Form::Sales::Pages::Buyer1IncomeMinValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.income.under_soft_min_for_economic_status.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

3
app/models/form/sales/pages/buyer2_income_max_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::Buyer2IncomeMaxValueCheck < ::Form::Page
"income2_over_soft_max?" => true, "income2_over_soft_max?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.income2_value_check.max"
@title_text = { @title_text = {
"translation" => "soft_validations.income.over_soft_max_for_la_buyer_2", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",

5
app/models/form/sales/pages/buyer2_income_min_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::Buyer2IncomeMinValueCheck < ::Form::Page
"income2_under_soft_min?" => true, "income2_under_soft_min?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.income2_value_check.min"
@title_text = { @title_text = {
"translation" => "soft_validations.income.under_soft_min_for_economic_status.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
@ -22,7 +23,7 @@ class Form::Sales::Pages::Buyer2IncomeMinValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.income.under_soft_min_for_economic_status.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

3
app/models/form/sales/pages/combined_income_max_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::CombinedIncomeMaxValueCheck < ::Form::Page
"combined_income_over_soft_max?" => true, "combined_income_over_soft_max?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.combined_income_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.income.over_soft_max_for_la_combined", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",

5
app/models/form/sales/pages/deposit_value_check.rb

@ -1,12 +1,13 @@
class Form::Sales::Pages::DepositValueCheck < ::Form::Page class Form::Sales::Pages::DepositValueCheck < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:) def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection) super(id, hsh, subsection)
@copy_key = "sales.soft_validations.deposit_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@informative_text = { @informative_text = {
"translation" => "soft_validations.deposit.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@title_text = { @title_text = {
"translation" => "soft_validations.deposit.title_text.#{joint_purchase ? 'two' : 'one'}", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",

6
app/models/form/sales/pages/mortgage_value_check.rb

@ -2,10 +2,10 @@ class Form::Sales::Pages::MortgageValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index = nil) def initialize(id, hsh, subsection, person_index = nil)
super(id, hsh, subsection) super(id, hsh, subsection)
@depends_on = depends_on @depends_on = depends_on
@informative_text = {}
@person_index = person_index @person_index = person_index
@copy_key = "sales.soft_validations.mortgage_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.mortgage.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
@ -15,7 +15,7 @@ class Form::Sales::Pages::MortgageValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.mortgage.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

5
app/models/form/sales/pages/savings_value_check.rb

@ -1,8 +1,9 @@
class Form::Sales::Pages::SavingsValueCheck < ::Form::Page class Form::Sales::Pages::SavingsValueCheck < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:) def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection) super(id, hsh, subsection)
@copy_key = "sales.soft_validations.savings_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@title_text = { @title_text = {
"translation" => "soft_validations.savings.title_text.#{joint_purchase ? 'two' : 'one'}", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
@ -12,7 +13,7 @@ class Form::Sales::Pages::SavingsValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.savings.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@joint_purchase = joint_purchase @joint_purchase = joint_purchase

3
app/models/form/sales/questions/buyer1_income_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer1IncomeValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:) def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page) super(id, hsh, page)
@id = "income1_value_check" @id = "income1_value_check"
@check_answer_label = "Buyer 1 income confirmation" @copy_key = "sales.soft_validations.income1_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

3
app/models/form/sales/questions/buyer2_income_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:) def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page) super(id, hsh, page)
@id = "income2_value_check" @id = "income2_value_check"
@check_answer_label = "Buyer 2 income confirmation" @copy_key = "sales.soft_validations.income2_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

3
app/models/form/sales/questions/combined_income_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::CombinedIncomeValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:) def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page) super(id, hsh, page)
@id = "combined_income_value_check" @id = "combined_income_value_check"
@check_answer_label = "Combined income confirmation" @copy_key = "sales.soft_validations.combined_income_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

3
app/models/form/sales/questions/deposit_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::DepositValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "deposit_value_check" @id = "deposit_value_check"
@check_answer_label = "Deposit confirmation" @copy_key = "sales.soft_validations.deposit_value_check"
@header = "Are you sure that the deposit is this much higher than the buyer's savings?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

3
app/models/form/sales/questions/mortgage_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::MortgageValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "mortgage_value_check" @id = "mortgage_value_check"
@check_answer_label = "Mortgage confirmation" @copy_key = "sales.soft_validations.mortgage_value_check"
@header = "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

3
app/models/form/sales/questions/savings_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::SavingsValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "savings_value_check" @id = "savings_value_check"
@check_answer_label = "Savings confirmation" @copy_key = "sales.soft_validations.savings_value_check"
@header = "Are you sure the savings are higher than £100,000?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

20
config/locales/en.yml

@ -703,13 +703,6 @@ en:
message: "Net income is lower than expected based on the household’s working situation. Are you sure this is correct?" message: "Net income is lower than expected based on the household’s working situation. Are you sure this is correct?"
in_soft_max_range: in_soft_max_range:
message: "Net income is higher than expected based on the household’s working situation. Are you sure this is correct?" message: "Net income is higher than expected based on the household’s working situation. Are you sure this is correct?"
income:
under_soft_min_for_economic_status:
title_text: "You told us income was %{income}."
hint_text: "This is less than we would expect for someone in this working situation."
over_soft_max_for_la_buyer_1: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
over_soft_max_for_la_buyer_2: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
over_soft_max_for_la_combined: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
rent: rent:
outside_range_title: "You told us the rent is %{brent}." outside_range_title: "You told us the rent is %{brent}."
informative_text: "This is %{higher_or_lower} than we would expect." informative_text: "This is %{higher_or_lower} than we would expect."
@ -772,24 +765,11 @@ Make sure these answers are correct."
percentage_discount_value: percentage_discount_value:
title_text: "You told us that the percentage discount is %{discount}." title_text: "You told us that the percentage discount is %{discount}."
hint_text: "This is higher than we would expect." hint_text: "This is higher than we would expect."
savings:
title_text:
one: "You told us the buyer’s savings were %{savings}."
two: "You told us the buyers’ savings were %{savings}."
hint_text: "This is higher than we would expect."
deposit:
title_text:
one: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
two: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
hint_text: "The deposit amount is higher than we would expect for the amount of savings they have."
grant: grant:
title_text: "You told us that the grant amount is %{grant}." title_text: "You told us that the grant amount is %{grant}."
hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000." hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
wheelchair: wheelchair:
title_text: "You told us that someone in the household uses a wheelchair." title_text: "You told us that someone in the household uses a wheelchair."
mortgage:
title_text: "You told us that the mortgage amount is %{mortgage}."
hint_text: "This is more than 5 times the income, which is higher than we would expect."
referral: referral:
title_text: "Are you sure?" title_text: "Are you sure?"
hint_text: "This is a general needs log, and this referral type is for supported housing." hint_text: "This is a general needs log, and this referral type is for supported housing."

60
config/locales/forms/2023/sales/soft_validations.en.yml

@ -0,0 +1,60 @@
en:
forms:
2023:
sales:
soft_validations:
income1_value_check:
page_header: ""
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
min:
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
income2_value_check:
page_header: ""
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
min:
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
combined_income_value_check:
page_header: ""
check_answer_label: "Combined income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
hint_text: ""
question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
hint_text: ""
question_text: "Are you sure the savings are higher than £100,000?"
joint_purchase:
title_text: You told us the buyers’ savings were %{savings}."
informative_text: "This is higher than we would expect."
not_joint_purchase:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
deposit_value_check::
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
joint_purchase:
title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
not_joint_purchase:
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."

60
config/locales/forms/2024/sales/soft_validations.en.yml

@ -0,0 +1,60 @@
en:
forms:
2024:
sales:
soft_validations:
income1_value_check:
page_header: ""
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
min:
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
income2_value_check:
page_header: ""
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
min:
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
combined_income_value_check:
page_header: ""
check_answer_label: "Combined income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
hint_text: ""
question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
hint_text: ""
question_text: "Are you sure the savings are higher than £100,000?"
joint_purchase:
title_text: You told us the buyers’ savings were %{savings}."
informative_text: "This is higher than we would expect."
not_joint_purchase:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
deposit_value_check::
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
joint_purchase:
title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
not_joint_purchase:
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."

3
spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::Buyer1IncomeMaxValueCheck, type: :model do
let(:page_id) { "prefix_buyer_1_income_max_value_check" } let(:page_id) { "prefix_buyer_1_income_max_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::Buyer1IncomeMinValueCheck, type: :model do
let(:page_id) { "prefix_buyer_1_income_min_value_check" } let(:page_id) { "prefix_buyer_1_income_min_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::Buyer2IncomeMaxValueCheck, type: :model do
let(:page_id) { "prefix_buyer_2_income_max_value_check" } let(:page_id) { "prefix_buyer_2_income_max_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::Buyer2IncomeMinValueCheck, type: :model do
let(:page_id) { "prefix_buyer_2_income_min_value_check" } let(:page_id) { "prefix_buyer_2_income_min_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/combined_income_max_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::CombinedIncomeMaxValueCheck, type: :model do
let(:page_id) { "prefix_combined_income_max_value_check" } let(:page_id) { "prefix_combined_income_max_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/deposit_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::DepositValueCheck, type: :model do
let(:page_id) { "deposit_value_check" } let(:page_id) { "deposit_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/mortgage_value_check_spec.rb

@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::MortgageValueCheck, type: :model do
let(:page_id) { "buyer_1_income_mortgage_value_check" } let(:page_id) { "buyer_1_income_mortgage_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:index) { 1 } let(:index) { 1 }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

3
spec/models/form/sales/pages/savings_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::SavingsValueCheck, type: :model do
let(:page_id) { "savings_value_check" } let(:page_id) { "savings_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

Loading…
Cancel
Save