From f336e3f271c72c26d392a6ce600c192b50ae23d1 Mon Sep 17 00:00:00 2001 From: Aaron Spencer <62190777+Airk0n@users.noreply.github.com> Date: Wed, 21 Jun 2023 10:55:19 +0100 Subject: [PATCH] CLDC 1507: Explain rent types details added to rent type question page (#1699) * CLDC-1507: rent explanation added to rent type question page. * CLDC-1507: 'Rent Type' headed added above question * CLDC-1507: test amended to include new header. * CLDC-1507: guidance partial test added * CLDC-1507: LSEP unicode character removed from definition --- app/models/form/lettings/pages/rent_type.rb | 1 + .../form/lettings/questions/rent_type.rb | 2 ++ .../form/guidance/_rent_type_definitions.erb | 21 +++++++++++++++++++ .../form/lettings/pages/rent_type_spec.rb | 2 +- .../form/lettings/questions/rent_type_spec.rb | 4 ++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/views/form/guidance/_rent_type_definitions.erb diff --git a/app/models/form/lettings/pages/rent_type.rb b/app/models/form/lettings/pages/rent_type.rb index faf3dfefc..b3e52d0e2 100644 --- a/app/models/form/lettings/pages/rent_type.rb +++ b/app/models/form/lettings/pages/rent_type.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::RentType < ::Form::Page def initialize(_id, hsh, subsection) super("rent_type", hsh, subsection) @derived = true + @header = "Rent Type" end def questions diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index ac9164f0c..b902539a3 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -5,6 +5,8 @@ class Form::Lettings::Questions::RentType < ::Form::Question @check_answer_label = "Rent type" @header = "What is the rent type?" @type = "radio" + @guidance_partial = "rent_type_definitions" + @guidance_position = GuidancePosition::TOP @answer_options = ANSWER_OPTIONS @conditional_for = { "irproduct_other" => [5] } @question_number = 6 diff --git a/app/views/form/guidance/_rent_type_definitions.erb b/app/views/form/guidance/_rent_type_definitions.erb new file mode 100644 index 000000000..1e008ee60 --- /dev/null +++ b/app/views/form/guidance/_rent_type_definitions.erb @@ -0,0 +1,21 @@ +<%= govuk_details(summary_text: "Rent type definitions") do %> +
+ Affordable Rent: where up to 80% of market rent can be charged. A new supply agreement is signed with Homes England or the Greater London Authority (GLA). +
++ London Affordable Rent: a tenure of affordable housing available in London by the GLA. It is an affordable rent which must be set in accordance with the Regulator of Social Housing’s Affordable Rent guidance. The landlord of these homes must be registered with the Regulator of Social Housing. These are a type of Affordable Rent lettings. +
++ London Living Rent: a tenure of affordable housing available in London by the GLA. It was introduced in Affordable Homes Programme 2016 to 2021. These are a type of Intermediate Rent lettings. +
++ Rent to Buy: a discount of up to 20% market rent is charged for a single rental period for a minimum of 5 years. After that period, the tenant is offered first chance to purchase the property (either shared ownership or outright) at full market value. These are a type of Intermediate Rent lettings. +
++ Social Rent: where target rents are determined through the national rent regime. This is sometimes also known as 'formula rent'. +
+ ++ Other intermediate rent: any other specific scheme where up to 80% of market rent can be charged. This includes schemes with reduced rent so tenants can save towards a house purchasing deposit and schemes with an in-built future opportunity to buy the property being rented. +
+<% end %> diff --git a/spec/models/form/lettings/pages/rent_type_spec.rb b/spec/models/form/lettings/pages/rent_type_spec.rb index ffe9bf15f..0d02791da 100644 --- a/spec/models/form/lettings/pages/rent_type_spec.rb +++ b/spec/models/form/lettings/pages/rent_type_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Form::Lettings::Pages::RentType, type: :model do end it "has the correct header" do - expect(page.header).to be_nil + expect(page.header).to eq("Rent Type") end it "has the correct description" do diff --git a/spec/models/form/lettings/questions/rent_type_spec.rb b/spec/models/form/lettings/questions/rent_type_spec.rb index 4609b0568..f78233a44 100644 --- a/spec/models/form/lettings/questions/rent_type_spec.rb +++ b/spec/models/form/lettings/questions/rent_type_spec.rb @@ -49,4 +49,8 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do it "is not marked as derived" do expect(question.derived?).to be false end + + it "has the guidance partial" do + expect(question.guidance_partial).to eq("rent_type_definitions") + end end