Browse Source

CLDC-3161 Update shared ownership type hint and details (#2172)

* Update shared ownership type hint and details

* Test
pull/2175/head
kosiakkatrina 11 months ago committed by GitHub
parent
commit
b468e1aa73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      app/models/form/sales/questions/shared_ownership_type.rb
  2. 26
      app/views/form/guidance/_shared_ownership_type_definitions_2024.erb
  3. 2
      spec/models/form/sales/pages/shared_ownership_type_spec.rb
  4. 18
      spec/models/form/sales/questions/shared_ownership_type_spec.rb

15
app/models/form/sales/questions/shared_ownership_type.rb

@ -4,13 +4,20 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question
@id = "type" @id = "type"
@check_answer_label = "Type of shared ownership sale" @check_answer_label = "Type of shared ownership sale"
@header = "What is the 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 @top_guidance_partial = guidance_partial
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@question_number = 4 @question_number = 4
end 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 def answer_options
if form.start_date.year >= 2023 if form.start_date.year >= 2023
{ {
@ -37,6 +44,10 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question
end end
def guidance_partial 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
end end

26
app/views/form/guidance/_shared_ownership_type_definitions_2024.erb

@ -0,0 +1,26 @@
<%= govuk_details(summary_text: "Shared ownership type definitions") do %>
<p class="govuk-body">
<b>Shared Ownership (old model lease):</b> Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the new model lease for these properties.
</p>
<p class="govuk-body">
<b>Shared Ownership (new model lease):</b> Homes bought using the Affordable Homes Programme 2021 to 2026.
</p>
<p class="govuk-body">
<b>Social HomeBuy — shared ownership purchase:</b> Tenants of private registered providers purchase their home at discount on Shared Ownership terms.
</p>
<p class="govuk-body">
<b>Home Ownership for people with Long-Term Disabilities (HOLD):</b> A shared ownership sale for those with long term disabilities.
</p>
<p class="govuk-body">
<b>Older Persons Shared Ownership:</b> A type of shared ownership for those 55 years and over.
</p>
<p class="govuk-body">
<b>Rent to Buy — Shared Ownership:</b> A sale following a period of discounted rent.
</p>
<p class="govuk-body">
<b>Right to Shared Ownership (RtSO):</b> A sale of a share of a rented home to a tenant using this scheme.
</p>
<p class="govuk-body">
<b>London Living Rent — Shared Ownership:</b> A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme.
</p>
<% end %>

2
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_id) { nil }
let(:page_definition) { 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) } let(:start_date) { Time.utc(2022, 4, 1) }
describe "headers" do describe "headers" do

18
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(:subsection) { instance_double(Form::Subsection, form:) }
let(:page) { instance_double(Form::Page, subsection:) } 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 it "has correct page" do
expect(question.page).to eq(page) expect(question.page).to eq(page)
end 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") expect(question.top_guidance_partial).to eq("shared_ownership_type_definitions")
end end
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 end

Loading…
Cancel
Save