From b468e1aa732d4f25807abac4353a595f03a7d869 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 26 Jan 2024 10:49:18 +0000 Subject: [PATCH] CLDC-3161 Update shared ownership type hint and details (#2172) * Update shared ownership type hint and details * Test --- .../sales/questions/shared_ownership_type.rb | 15 +++++++++-- ...shared_ownership_type_definitions_2024.erb | 26 +++++++++++++++++++ .../sales/pages/shared_ownership_type_spec.rb | 2 +- .../questions/shared_ownership_type_spec.rb | 18 +++++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 app/views/form/guidance/_shared_ownership_type_definitions_2024.erb diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb index 658aa3139..997e46c35 100644 --- a/app/models/form/sales/questions/shared_ownership_type.rb +++ b/app/models/form/sales/questions/shared_ownership_type.rb @@ -4,13 +4,20 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question @id = "type" @check_answer_label = "Type of shared ownership sale" @header = "What is the type of shared ownership sale?" - @hint_text = "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" @top_guidance_partial = guidance_partial @type = "radio" @answer_options = answer_options @question_number = 4 end + def hint_text + if form.start_year_after_2024? + "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" + else + "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" + end + end + def answer_options if form.start_date.year >= 2023 { @@ -37,6 +44,10 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question end def guidance_partial - "shared_ownership_type_definitions" if form.start_date.year >= 2023 + if form.start_year_after_2024? + "shared_ownership_type_definitions_2024" + elsif form.start_date.year >= 2023 + "shared_ownership_type_definitions" + end end end diff --git a/app/views/form/guidance/_shared_ownership_type_definitions_2024.erb b/app/views/form/guidance/_shared_ownership_type_definitions_2024.erb new file mode 100644 index 000000000..bce41c43b --- /dev/null +++ b/app/views/form/guidance/_shared_ownership_type_definitions_2024.erb @@ -0,0 +1,26 @@ +<%= govuk_details(summary_text: "Shared ownership type definitions") do %> +
+ Shared Ownership (old model lease): Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the new model lease for these properties. +
++ Shared Ownership (new model lease): Homes bought using the Affordable Homes Programme 2021 to 2026. +
++ Social HomeBuy — shared ownership purchase: Tenants of private registered providers purchase their home at discount on Shared Ownership terms. +
++ Home Ownership for people with Long-Term Disabilities (HOLD): A shared ownership sale for those with long term disabilities. +
++ Older Persons Shared Ownership: A type of shared ownership for those 55 years and over. +
++ Rent to Buy — Shared Ownership: A sale following a period of discounted rent. +
++ Right to Shared Ownership (RtSO): A sale of a share of a rented home to a tenant using this scheme. +
++ London Living Rent — Shared Ownership: A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme. +
+<% end %> diff --git a/spec/models/form/sales/pages/shared_ownership_type_spec.rb b/spec/models/form/sales/pages/shared_ownership_type_spec.rb index dfed74fb3..33d996a2b 100644 --- a/spec/models/form/sales/pages/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_type_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipType, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:, start_year_after_2024?: false)) } let(:start_date) { Time.utc(2022, 4, 1) } describe "headers" do diff --git a/spec/models/form/sales/questions/shared_ownership_type_spec.rb b/spec/models/form/sales/questions/shared_ownership_type_spec.rb index 693d58de9..1700fb277 100644 --- a/spec/models/form/sales/questions/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_type_spec.rb @@ -10,6 +10,10 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do let(:subsection) { instance_double(Form::Subsection, form:) } let(:page) { instance_double(Form::Page, subsection:) } + before do + allow(form).to receive(:start_year_after_2024?).and_return(false) + end + it "has correct page" do expect(question.page).to eq(page) end @@ -78,4 +82,18 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do expect(question.top_guidance_partial).to eq("shared_ownership_type_definitions") end end + + context "when form start date is on or after 2024/25" do + before do + allow(form).to receive(:start_year_after_2024?).and_return(true) + end + + it "shows shows correct top_guidance_partial" do + expect(question.top_guidance_partial).to eq("shared_ownership_type_definitions_2024") + end + + it "has the correct hint_text" do + expect(question.hint_text).to eq("When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction") + end + end end