From eeca40521fe27d1e621dc1dda1fad5663ba24e9e Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 2 Oct 2024 09:41:05 +0100 Subject: [PATCH 01/45] WIP --- .../form/sales/questions/created_by_id.rb | 5 +++-- .../sales/questions/managing_organisation.rb | 5 +++-- .../sales/questions/owning_organisation_id.rb | 5 +++-- config/locales/forms/2024/sales/setup.en.yml | 21 +++++++++++++++++++ 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 config/locales/forms/2024/sales/setup.en.yml diff --git a/app/models/form/sales/questions/created_by_id.rb b/app/models/form/sales/questions/created_by_id.rb index 15a10e893..810c4966d 100644 --- a/app/models/form/sales/questions/created_by_id.rb +++ b/app/models/form/sales/questions/created_by_id.rb @@ -4,8 +4,9 @@ class Form::Sales::Questions::CreatedById < ::Form::Question def initialize(id, hsh, page) super @id = "assigned_to_id" - @check_answer_label = "Log owner" - @header = "Which user are you creating this log for?" + @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.check_answer_label") + @header = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.question_text") + @hint = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.hint_text") @derived = true @type = "select" end diff --git a/app/models/form/sales/questions/managing_organisation.rb b/app/models/form/sales/questions/managing_organisation.rb index 03609233e..2c2f219cc 100644 --- a/app/models/form/sales/questions/managing_organisation.rb +++ b/app/models/form/sales/questions/managing_organisation.rb @@ -2,8 +2,9 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question def initialize(id, hsh, page) super @id = "managing_organisation_id" - @check_answer_label = "Reported by" - @header = "Which organisation is reporting this sale?" + @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.check_answer_label") + @header = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.question_text") + @hint = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.hint_text") @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/owning_organisation_id.rb b/app/models/form/sales/questions/owning_organisation_id.rb index 669c43a0e..593ec3951 100644 --- a/app/models/form/sales/questions/owning_organisation_id.rb +++ b/app/models/form/sales/questions/owning_organisation_id.rb @@ -2,8 +2,9 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question def initialize(id, hsh, page) super @id = "owning_organisation_id" - @check_answer_label = "Owning organisation" - @header = "Which organisation owns this log?" + @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.check_answer_label") + @header = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.question_text") + @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.hint_text") @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml new file mode 100644 index 000000000..b5fcfc7d6 --- /dev/null +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -0,0 +1,21 @@ +en: + forms: + 2024: + sales: + setup: + owning_organisation_id: + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + From 615ebfeff831c34e8a7884d35a7c2025e514f854 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 2 Oct 2024 12:28:13 +0100 Subject: [PATCH 02/45] WIP --- .../sales/pages/outright_ownership_type.rb | 2 +- .../form/sales/questions/ownership_scheme.rb | 5 +++-- .../form/sales/questions/purchaser_code.rb | 6 +++--- app/models/form/sales/questions/sale_date.rb | 5 +++-- app/views/form/_date_question.html.erb | 2 +- config/locales/forms/2024/sales/setup.en.yml | 18 ++++++++++++++++++ 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/app/models/form/sales/pages/outright_ownership_type.rb b/app/models/form/sales/pages/outright_ownership_type.rb index 099b45d07..1361bf27f 100644 --- a/app/models/form/sales/pages/outright_ownership_type.rb +++ b/app/models/form/sales/pages/outright_ownership_type.rb @@ -16,6 +16,6 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page end def header - "Type of outright sale" if form.start_date.year >= 2023 + "Type of outright sale page" if form.start_date.year >= 2023 end end diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 9fabb49dc..770040e5e 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -2,8 +2,9 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question def initialize(id, hsh, page) super @id = "ownershipsch" - @check_answer_label = "Purchase made under ownership scheme" - @header = "Was this purchase made through an ownership scheme?" + @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.check_answer_label") + @header = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.question_text") + @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.hint_text") @type = "radio" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/purchaser_code.rb b/app/models/form/sales/questions/purchaser_code.rb index 12ff7f1de..03f88a936 100644 --- a/app/models/form/sales/questions/purchaser_code.rb +++ b/app/models/form/sales/questions/purchaser_code.rb @@ -2,9 +2,9 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question def initialize(id, hsh, page) super @id = "purchid" - @check_answer_label = "Purchaser code" - @header = "What is the purchaser code?" - @hint_text = "This is how you usually refer to the purchaser on your own systems." + @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.check_answer_label") + @header = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.question_text") + @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.hint_text") @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/sale_date.rb b/app/models/form/sales/questions/sale_date.rb index ae02f1cfd..d850f8904 100644 --- a/app/models/form/sales/questions/sale_date.rb +++ b/app/models/form/sales/questions/sale_date.rb @@ -2,8 +2,9 @@ class Form::Sales::Questions::SaleDate < ::Form::Question def initialize(id, hsh, page) super @id = "saledate" - @check_answer_label = "Sale completion date" - @header = "What is the sale completion date?" + @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.check_answer_label") + @header = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.question_text") + @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.hint_text") @type = "date" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb index 1be21d212..aded6f3b3 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -3,7 +3,7 @@ <%= f.govuk_date_field question.id.to_sym, caption: caption(caption_text, page_header, conditional), legend: legend(question, page_header, conditional), - hint: { text: (question.hint_text.nil? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" }, + hint: { text: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" }, width: 20, **stimulus_html_attributes(question) do %> <%= govuk_inset_text(text: question.unresolved_hint_text) if question.unresolved_hint_text.present? && @log.unresolved %> diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml index b5fcfc7d6..7e6f8878b 100644 --- a/config/locales/forms/2024/sales/setup.en.yml +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -18,4 +18,22 @@ en: hint_text: "" question_text: "Which user are you creating this log for?" + saledate: + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownerschipsch: + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + From bd47018f4712c38a87243c3702abe9ccf21b0795 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Thu, 3 Oct 2024 17:31:10 +0100 Subject: [PATCH 03/45] CLDC-3650: Pull out copy for sales setup section questions to translation file --- app/models/form/page.rb | 6 + app/models/form/question.rb | 19 +++ app/models/form/sales/pages/buyer_company.rb | 1 + .../form/sales/pages/buyer_interview.rb | 1 + app/models/form/sales/pages/buyer_live.rb | 1 + app/models/form/sales/pages/created_by.rb | 1 + .../sales/pages/discounted_ownership_type.rb | 5 +- app/models/form/sales/pages/joint_purchase.rb | 1 + .../form/sales/pages/managing_organisation.rb | 1 + .../form/sales/pages/number_joint_buyers.rb | 1 + .../form/sales/pages/ownership_scheme.rb | 1 + .../form/sales/pages/owning_organisation.rb | 1 + app/models/form/sales/pages/purchaser_code.rb | 1 + app/models/form/sales/pages/sale_date.rb | 1 + .../form/sales/pages/shared_ownership_type.rb | 5 +- .../form/sales/questions/buyer_company.rb | 3 +- .../form/sales/questions/buyer_interview.rb | 4 +- app/models/form/sales/questions/buyer_live.rb | 3 +- .../form/sales/questions/created_by_id.rb | 4 +- .../questions/discounted_ownership_type.rb | 3 +- .../form/sales/questions/joint_purchase.rb | 9 +- .../sales/questions/managing_organisation.rb | 4 +- .../sales/questions/number_joint_buyers.rb | 11 +- .../form/sales/questions/ownership_scheme.rb | 4 +- .../sales/questions/owning_organisation_id.rb | 4 +- .../form/sales/questions/privacy_notice.rb | 3 +- .../form/sales/questions/purchaser_code.rb | 4 +- app/models/form/sales/questions/sale_date.rb | 4 +- .../sales/questions/shared_ownership_type.rb | 11 +- config/locales/forms/2023/sales/setup.en.yml | 110 ++++++++++++++++++ config/locales/forms/2024/sales/setup.en.yml | 73 +++++++++++- 31 files changed, 234 insertions(+), 66 deletions(-) create mode 100644 config/locales/forms/2023/sales/setup.en.yml diff --git a/app/models/form/page.rb b/app/models/form/page.rb index f1d6497a0..d6403cf2d 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -24,6 +24,12 @@ class Form::Page delegate :form, to: :subsection + def header + @header if @copy_key.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.page_header") + end + def routed_to?(log, _current_user) return true unless depends_on || subsection.depends_on diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 1fbced841..dac903a5a 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -11,6 +11,7 @@ class Form::Question def initialize(id, hsh, page) @id = id @page = page + @copy_reference = nil if hsh @check_answer_label = hsh["check_answer_label"] @header = hsh["header"] @@ -48,6 +49,24 @@ class Form::Question delegate :subsection, to: :page delegate :form, to: :subsection + def check_answer_label + return @check_answer_label if @copy_reference.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.check_answer_label") + end + + def header + return @header if @copy_key.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.question_text") + end + + def hint_text + return @hint_text if @copy_key.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.hint_text") + end + def answer_label(log, user = nil) return checkbox_answer_label(log) if type == "checkbox" return log[id]&.to_formatted_s(:govuk_date).to_s if type == "date" diff --git a/app/models/form/sales/pages/buyer_company.rb b/app/models/form/sales/pages/buyer_company.rb index dbe1afcec..cc2d962fe 100644 --- a/app/models/form/sales/pages/buyer_company.rb +++ b/app/models/form/sales/pages/buyer_company.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerCompany < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_company" + @copy_key = "sales.setup.companybuy" @depends_on = [{ "outright_sale?" => true, }] diff --git a/app/models/form/sales/pages/buyer_interview.rb b/app/models/form/sales/pages/buyer_interview.rb index f9c4e3bbc..d042db288 100644 --- a/app/models/form/sales/pages/buyer_interview.rb +++ b/app/models/form/sales/pages/buyer_interview.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerInterview < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) @joint_purchase = joint_purchase + @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" end def questions diff --git a/app/models/form/sales/pages/buyer_live.rb b/app/models/form/sales/pages/buyer_live.rb index d0b772355..6606f8ed4 100644 --- a/app/models/form/sales/pages/buyer_live.rb +++ b/app/models/form/sales/pages/buyer_live.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerLive < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_live" + @copy_key = "sales.setup.buylivein" @depends_on = [{ "companybuy" => 2, }] diff --git a/app/models/form/sales/pages/created_by.rb b/app/models/form/sales/pages/created_by.rb index e68fc6a30..d40b522df 100644 --- a/app/models/form/sales/pages/created_by.rb +++ b/app/models/form/sales/pages/created_by.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::CreatedBy < ::Form::Page def initialize(id, hsh, subsection) super @id = "assigned_to" + @copy_key = "assigned_to_id" end def questions diff --git a/app/models/form/sales/pages/discounted_ownership_type.rb b/app/models/form/sales/pages/discounted_ownership_type.rb index 3fe2011ef..346ad4467 100644 --- a/app/models/form/sales/pages/discounted_ownership_type.rb +++ b/app/models/form/sales/pages/discounted_ownership_type.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "discounted_ownership_type" + @copy_key = "sales.setup.type.discounted_ownership" @header = header @depends_on = [{ "ownershipsch" => 2, @@ -13,8 +14,4 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page Form::Sales::Questions::DiscountedOwnershipType.new(nil, nil, self), ] end - - def header - "Type of discounted ownership sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/pages/joint_purchase.rb b/app/models/form/sales/pages/joint_purchase.rb index bec7c88c1..e3b0156b7 100644 --- a/app/models/form/sales/pages/joint_purchase.rb +++ b/app/models/form/sales/pages/joint_purchase.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::JointPurchase < ::Form::Page def initialize(id, hsh, subsection) super @id = "joint_purchase" + @copy_key = "sales.setup.jointpur" @depends_on = [ { "ownershipsch" => 1 }, { "ownershipsch" => 2 }, diff --git a/app/models/form/sales/pages/managing_organisation.rb b/app/models/form/sales/pages/managing_organisation.rb index 3d8e59383..bbb046f6b 100644 --- a/app/models/form/sales/pages/managing_organisation.rb +++ b/app/models/form/sales/pages/managing_organisation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::ManagingOrganisation < ::Form::Page def initialize(id, hsh, subsection) super @id = "managing_organisation" + @copy_key = "sales.setup.managing_organisation_id" end def questions diff --git a/app/models/form/sales/pages/number_joint_buyers.rb b/app/models/form/sales/pages/number_joint_buyers.rb index 3a8c3475d..456fb61e9 100644 --- a/app/models/form/sales/pages/number_joint_buyers.rb +++ b/app/models/form/sales/pages/number_joint_buyers.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::NumberJointBuyers < ::Form::Page def initialize(id, hsh, subsection) super @id = "number_joint_buyers" + @copy_key = "sales.setup.jointmore" @depends_on = [{ "joint_purchase?" => true, }] diff --git a/app/models/form/sales/pages/ownership_scheme.rb b/app/models/form/sales/pages/ownership_scheme.rb index d92e56600..6e1ca5cfe 100644 --- a/app/models/form/sales/pages/ownership_scheme.rb +++ b/app/models/form/sales/pages/ownership_scheme.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::OwnershipScheme < ::Form::Page def initialize(id, hsh, subsection) super @id = "ownership_scheme" + @copy_key = "sales.setup.ownershipsch" end def questions diff --git a/app/models/form/sales/pages/owning_organisation.rb b/app/models/form/sales/pages/owning_organisation.rb index f0c9e4e68..e3b093b83 100644 --- a/app/models/form/sales/pages/owning_organisation.rb +++ b/app/models/form/sales/pages/owning_organisation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::OwningOrganisation < ::Form::Page def initialize(id, hsh, subsection) super @id = "owning_organisation" + @copy_key = "sales.setup.owning_organisation_id" end def questions diff --git a/app/models/form/sales/pages/purchaser_code.rb b/app/models/form/sales/pages/purchaser_code.rb index 8282453ad..ec61d50dd 100644 --- a/app/models/form/sales/pages/purchaser_code.rb +++ b/app/models/form/sales/pages/purchaser_code.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::PurchaserCode < ::Form::Page def initialize(id, hsh, subsection) super @id = "purchaser_code" + @copy_key = "sales.setup.purchid" end def questions diff --git a/app/models/form/sales/pages/sale_date.rb b/app/models/form/sales/pages/sale_date.rb index 036e04907..3a9432623 100644 --- a/app/models/form/sales/pages/sale_date.rb +++ b/app/models/form/sales/pages/sale_date.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::SaleDate < ::Form::Page def initialize(id, hsh, subsection) super @id = "completion_date" + @copy_key = "sales.setup.saledate" end def questions diff --git a/app/models/form/sales/pages/shared_ownership_type.rb b/app/models/form/sales/pages/shared_ownership_type.rb index 3e65cb628..304c58730 100644 --- a/app/models/form/sales/pages/shared_ownership_type.rb +++ b/app/models/form/sales/pages/shared_ownership_type.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "shared_ownership_type" + @copy_key = "sales.setup.type.shared_ownership" @header = header @depends_on = [{ "ownershipsch" => 1, @@ -13,8 +14,4 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page Form::Sales::Questions::SharedOwnershipType.new(nil, nil, self), ] end - - def header - "Type of shared ownership sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/questions/buyer_company.rb b/app/models/form/sales/questions/buyer_company.rb index 40763c818..9ca551e70 100644 --- a/app/models/form/sales/questions/buyer_company.rb +++ b/app/models/form/sales/questions/buyer_company.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question def initialize(id, hsh, page) super @id = "companybuy" - @check_answer_label = "Company buyer" - @header = "Is the buyer a company?" + @copy_key = "sales.setup.companybuy" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/buyer_interview.rb b/app/models/form/sales/questions/buyer_interview.rb index 4e7946151..8b434d11c 100644 --- a/app/models/form/sales/questions/buyer_interview.rb +++ b/app/models/form/sales/questions/buyer_interview.rb @@ -2,10 +2,8 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "noint" - @check_answer_label = "#{joint_purchase ? 'Buyers' : 'Buyer'} interviewed in person?" - @header = "#{joint_purchase ? 'Were the buyers' : 'Was the buyer'} interviewed for any of the answers you will provide on this log?" + @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "radio" - @hint_text = "You should still try to answer all questions even if the #{joint_purchase ? 'buyers weren’t' : 'buyer wasn’t'} interviewed in person" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/buyer_live.rb b/app/models/form/sales/questions/buyer_live.rb index 77153de0b..794b3c7bc 100644 --- a/app/models/form/sales/questions/buyer_live.rb +++ b/app/models/form/sales/questions/buyer_live.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::BuyerLive < ::Form::Question def initialize(id, hsh, page) super @id = "buylivein" - @check_answer_label = "Buyers living in property" - @header = form.start_year_after_2024? ? "Will any buyers live in the property?" : "Will the buyers live in the property?" + @copy_key = "sales.setup.buylivein" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/created_by_id.rb b/app/models/form/sales/questions/created_by_id.rb index 810c4966d..f4a40daff 100644 --- a/app/models/form/sales/questions/created_by_id.rb +++ b/app/models/form/sales/questions/created_by_id.rb @@ -4,9 +4,7 @@ class Form::Sales::Questions::CreatedById < ::Form::Question def initialize(id, hsh, page) super @id = "assigned_to_id" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.question_text") - @hint = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.hint_text") + @copy_key = "sales.setup.assigned_to_id" @derived = true @type = "select" end diff --git a/app/models/form/sales/questions/discounted_ownership_type.rb b/app/models/form/sales/questions/discounted_ownership_type.rb index e4062d485..6108e4ef8 100644 --- a/app/models/form/sales/questions/discounted_ownership_type.rb +++ b/app/models/form/sales/questions/discounted_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of discounted ownership sale" - @header = "What is the type of discounted ownership sale?" + @copy_key = "sales.setup.type.discounted_ownership" @type = "radio" @top_guidance_partial = guidance_partial @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/joint_purchase.rb b/app/models/form/sales/questions/joint_purchase.rb index 27da46bc0..9e47ca7a3 100644 --- a/app/models/form/sales/questions/joint_purchase.rb +++ b/app/models/form/sales/questions/joint_purchase.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question def initialize(id, hsh, page) super @id = "jointpur" - @check_answer_label = "Joint purchase" - @header = "Is this a joint purchase?" + @copy_key = "sales.setup.jointpur" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @@ -14,11 +13,5 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question "2" => { "value" => "No" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This is where two or more people are named as legal owners of the property after the purchase" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 11 }.freeze end diff --git a/app/models/form/sales/questions/managing_organisation.rb b/app/models/form/sales/questions/managing_organisation.rb index 2c2f219cc..f934a0cc7 100644 --- a/app/models/form/sales/questions/managing_organisation.rb +++ b/app/models/form/sales/questions/managing_organisation.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question def initialize(id, hsh, page) super @id = "managing_organisation_id" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.question_text") - @hint = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.hint_text") + @copy_key = "sales.setup.managing_organisation_id" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/number_joint_buyers.rb b/app/models/form/sales/questions/number_joint_buyers.rb index 95117bb44..147f78ef5 100644 --- a/app/models/form/sales/questions/number_joint_buyers.rb +++ b/app/models/form/sales/questions/number_joint_buyers.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question def initialize(id, hsh, page) super @id = "jointmore" - @check_answer_label = "More than 2 joint buyers" - @header = "Are there more than 2 joint buyers of this property?" + @copy_key = "sales.setup.jointmore" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @@ -15,13 +14,5 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - def hint_text - if form.start_year_after_2024? - nil - else - "You should still try to answer all questions even if the buyers weren’t interviewed in person" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 12 }.freeze end diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 770040e5e..38a97e824 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question def initialize(id, hsh, page) super @id = "ownershipsch" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.hint_text") + @copy_key = "sales.setup.ownershipsch" @type = "radio" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/owning_organisation_id.rb b/app/models/form/sales/questions/owning_organisation_id.rb index 593ec3951..adf777b48 100644 --- a/app/models/form/sales/questions/owning_organisation_id.rb +++ b/app/models/form/sales/questions/owning_organisation_id.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question def initialize(id, hsh, page) super @id = "owning_organisation_id" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.hint_text") + @copy_key = "sales.setup.owning_organisation_id" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 6e53f36ff..a9e737f0e 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "privacynotice" - @check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?" - @header = "Declaration" + @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "checkbox" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @joint_purchase = joint_purchase diff --git a/app/models/form/sales/questions/purchaser_code.rb b/app/models/form/sales/questions/purchaser_code.rb index 03f88a936..527dd659a 100644 --- a/app/models/form/sales/questions/purchaser_code.rb +++ b/app/models/form/sales/questions/purchaser_code.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question def initialize(id, hsh, page) super @id = "purchid" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.hint_text") + @copy_key = "sales.setup.purchid" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/sale_date.rb b/app/models/form/sales/questions/sale_date.rb index d850f8904..f969c32f2 100644 --- a/app/models/form/sales/questions/sale_date.rb +++ b/app/models/form/sales/questions/sale_date.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::SaleDate < ::Form::Question def initialize(id, hsh, page) super @id = "saledate" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.hint_text") + @copy_key = "sales.setup.saledate" @type = "date" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb index 4c1879888..1ede14a4d 100644 --- a/app/models/form/sales/questions/shared_ownership_type.rb +++ b/app/models/form/sales/questions/shared_ownership_type.rb @@ -2,22 +2,13 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of shared ownership sale" - @header = "What is the type of shared ownership sale?" + @copy_key = "sales.setup.type.shared_ownership" @top_guidance_partial = guidance_partial @type = "radio" @answer_options = answer_options @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] 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 { diff --git a/config/locales/forms/2023/sales/setup.en.yml b/config/locales/forms/2023/sales/setup.en.yml new file mode 100644 index 000000000..bed55803a --- /dev/null +++ b/config/locales/forms/2023/sales/setup.en.yml @@ -0,0 +1,110 @@ +en: + forms: + 2023: + sales: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + saledate: + page_header: "" + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + page_header: "" + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownershipsch: + page_header: "" + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "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" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + check_answer_label: "Type of discounted ownership sale" + hint_text: "" + question_text: "What is the type of discounted ownership sale?" + outright_ownership: + page_header: "Type of outright sale page" + type: + check_answer_label: "Type of outright sale" + hint_text: "" + question_text: "What is the type of outright sale?" + othtype: + check_answer_label: "Type of other sale" + hint_text: "" + question_text: "What type of sale is it?" + + companybuy: + page_header: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will the buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren't interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn't interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + + privacynotice: + joint_purchase: + page_header: "" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml index 7e6f8878b..2434817f1 100644 --- a/config/locales/forms/2024/sales/setup.en.yml +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -4,36 +4,107 @@ en: sales: setup: owning_organisation_id: + page_header: "" check_answer_label: "Owning organisation" hint_text: "" question_text: "Which organisation owns this log?" managing_organisation_id: + page_header: "" check_answer_label: "Reported by" hint_text: "" question_text: "Which organisation is reporting this sale?" assigned_to_id: + page_header: "" check_answer_label: "Log owner" hint_text: "" question_text: "Which user are you creating this log for?" saledate: + page_header: "" check_answer_label: "Sale completion date" hint_text: "" question_text: "What is the sale completion date?" purchid: + page_header: "" check_answer_label: "Purchaser code" hint_text: "This is how you usually refer to the purchaser on your own systems." question_text: "What is the purchaser code?" - ownerschipsch: + ownershipsch: + page_header: "" check_answer_label: "Purchase made under ownership scheme" hint_text: "" question_text: "Was this purchase made through an ownership scheme?" type: shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "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" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + check_answer_label: "Type of discounted ownership sale" + hint_text: "" + question_text: "What is the type of discounted ownership sale?" + outright_ownership: + page_header: "Type of outright sale page" + type: + check_answer_label: "Type of outright sale" + hint_text: "" + question_text: "What is the type of outright sale?" + othtype: + check_answer_label: "Type of other sale" + hint_text: "" + question_text: "What type of sale is it?" + companybuy: + page_header: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will any buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "This is where two or more people are named as legal owners of the property after the purchase" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren't interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn't interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + privacynotice: + joint_purchase: + page_header: "" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" From 27fc1277ae2106187fae2003ee8408d5ba0646f5 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Thu, 3 Oct 2024 17:32:49 +0100 Subject: [PATCH 04/45] Remove test word --- app/models/form/sales/pages/outright_ownership_type.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/models/form/sales/pages/outright_ownership_type.rb b/app/models/form/sales/pages/outright_ownership_type.rb index 1361bf27f..5d714153b 100644 --- a/app/models/form/sales/pages/outright_ownership_type.rb +++ b/app/models/form/sales/pages/outright_ownership_type.rb @@ -14,8 +14,4 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page Form::Sales::Questions::OtherOwnershipType.new(nil, nil, self), ] end - - def header - "Type of outright sale page" if form.start_date.year >= 2023 - end end From c9192aa4d69a60c7cf6b6458f5fa03465b519e18 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Fri, 4 Oct 2024 09:28:14 +0100 Subject: [PATCH 05/45] Fix page header --- app/models/form/page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/form/page.rb b/app/models/form/page.rb index d6403cf2d..9af24da23 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -25,7 +25,7 @@ class Form::Page delegate :form, to: :subsection def header - @header if @copy_key.nil? + return @header if @copy_key.nil? I18n.t("forms.#{form.start_date.year}.#{@copy_key}.page_header") end From bd69ec56d46180a56a67e9b1ce99fa39d1120df4 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Fri, 4 Oct 2024 10:09:39 +0100 Subject: [PATCH 06/45] More fixes --- app/models/form/question.rb | 2 +- .../form/sales/pages/discounted_ownership_type_spec.rb | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/form/question.rb b/app/models/form/question.rb index dac903a5a..f64fcc0b3 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -50,7 +50,7 @@ class Form::Question delegate :form, to: :subsection def check_answer_label - return @check_answer_label if @copy_reference.nil? + return @check_answer_label if @copy_key.nil? I18n.t("forms.#{form.start_date.year}.#{@copy_key}.check_answer_label") end diff --git a/spec/models/form/sales/pages/discounted_ownership_type_spec.rb b/spec/models/form/sales/pages/discounted_ownership_type_spec.rb index 708090420..d3b786e6d 100644 --- a/spec/models/form/sales/pages/discounted_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/discounted_ownership_type_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Pages::DiscountedOwnershipType, type: :model do expect(page.header).to eq("Type of discounted ownership sale") end end - - context "when form year is for before 2023/24" do - let(:start_date) { Time.zone.local(2022, 2, 8) } - - it "does not have a page header" do - expect(page.header).to eq(nil) - end - end end it "has correct subsection" do From f892f75631d0109fe1c81b1e834e94a53f12ab4e Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Fri, 4 Oct 2024 10:52:20 +0100 Subject: [PATCH 07/45] More fixes --- app/models/form/question.rb | 1 - app/models/form/sales/pages/created_by.rb | 2 +- spec/models/form/sales/pages/buyer_interview_spec.rb | 4 ---- spec/models/form/sales/pages/buyer_live_spec.rb | 4 ---- spec/models/form/sales/pages/created_by_spec.rb | 6 +----- spec/models/form/sales/pages/purchaser_code_spec.rb | 4 ---- 6 files changed, 2 insertions(+), 19 deletions(-) diff --git a/app/models/form/question.rb b/app/models/form/question.rb index f64fcc0b3..9d019db1d 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -11,7 +11,6 @@ class Form::Question def initialize(id, hsh, page) @id = id @page = page - @copy_reference = nil if hsh @check_answer_label = hsh["check_answer_label"] @header = hsh["header"] diff --git a/app/models/form/sales/pages/created_by.rb b/app/models/form/sales/pages/created_by.rb index d40b522df..b84764804 100644 --- a/app/models/form/sales/pages/created_by.rb +++ b/app/models/form/sales/pages/created_by.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::CreatedBy < ::Form::Page def initialize(id, hsh, subsection) super @id = "assigned_to" - @copy_key = "assigned_to_id" + @copy_key = "sales.setup.assigned_to_id" end def questions diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb index 73191593c..9065c3e57 100644 --- a/spec/models/form/sales/pages/buyer_interview_spec.rb +++ b/spec/models/form/sales/pages/buyer_interview_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do expect(page.id).to eq("buyer_interview") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_live_spec.rb b/spec/models/form/sales/pages/buyer_live_spec.rb index c46908dff..a26b265ec 100644 --- a/spec/models/form/sales/pages/buyer_live_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::BuyerLive, type: :model do expect(page.id).to eq("buyer_live") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/created_by_spec.rb b/spec/models/form/sales/pages/created_by_spec.rb index feb7489e2..7d9a25018 100644 --- a/spec/models/form/sales/pages/created_by_spec.rb +++ b/spec/models/form/sales/pages/created_by_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::CreatedBy, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } let(:form) { instance_double(Form) } let(:lettings_log) { instance_double(LettingsLog) } @@ -21,10 +21,6 @@ RSpec.describe Form::Sales::Pages::CreatedBy, type: :model do expect(page.id).to eq("assigned_to") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/purchaser_code_spec.rb b/spec/models/form/sales/pages/purchaser_code_spec.rb index d342b1683..68a853826 100644 --- a/spec/models/form/sales/pages/purchaser_code_spec.rb +++ b/spec/models/form/sales/pages/purchaser_code_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PurchaserCode, type: :model do expect(page.id).to eq("purchaser_code") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end From 4901547d03bde360c605152d0f57efe910dd8ef6 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 7 Oct 2024 10:28:50 +0100 Subject: [PATCH 08/45] Tidy --- app/models/form/page.rb | 2 +- app/models/form/question.rb | 4 ++-- spec/models/form/sales/questions/buyer_company_spec.rb | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/models/form/page.rb b/app/models/form/page.rb index 9af24da23..bc9edefe0 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -1,5 +1,5 @@ class Form::Page - attr_accessor :id, :header, :header_partial, :description, :questions, :depends_on, :title_text, + attr_accessor :id, :header_partial, :description, :questions, :depends_on, :title_text, :informative_text, :subsection, :hide_subsection_label, :next_unresolved_page_id, :skip_text, :interruption_screen_question_ids, :submit_text diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 9d019db1d..57ed70e66 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -1,7 +1,7 @@ class Form::Question - attr_accessor :id, :header, :hint_text, :description, :questions, :disable_clearing_if_not_routed_or_dynamic_answer_options, + attr_accessor :id, :description, :questions, :disable_clearing_if_not_routed_or_dynamic_answer_options, :type, :min, :max, :step, :width, :fields_to_add, :result_field, - :conditional_for, :readonly, :answer_options, :page, :check_answer_label, + :conditional_for, :readonly, :answer_options, :page, :inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value, :top_guidance_partial, :bottom_guidance_partial, :prefix, :suffix, :requires_js, :fields_added, :derived, :check_answers_card_number, diff --git a/spec/models/form/sales/questions/buyer_company_spec.rb b/spec/models/form/sales/questions/buyer_company_spec.rb index 76db2952f..5bf652db4 100644 --- a/spec/models/form/sales/questions/buyer_company_spec.rb +++ b/spec/models/form/sales/questions/buyer_company_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Sales::Questions::BuyerCompany, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, From 594fb9c2e819c604241e05aef250936a70fd3f3d Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 7 Oct 2024 11:34:52 +0100 Subject: [PATCH 09/45] More test fixes --- config/locales/forms/2023/sales/setup.en.yml | 4 +- config/locales/forms/2024/sales/setup.en.yml | 4 +- .../form/sales/pages/buyer_company_spec.rb | 4 -- .../form/sales/pages/buyer_live_spec.rb | 6 ++- .../form/sales/pages/joint_purchase_spec.rb | 4 -- .../sales/pages/managing_organisation_spec.rb | 4 -- .../sales/pages/number_joint_buyers_spec.rb | 4 -- .../pages/outright_ownership_type_spec.rb | 18 -------- .../form/sales/pages/ownership_scheme_spec.rb | 4 -- .../sales/pages/owning_organisation_spec.rb | 4 -- .../models/form/sales/pages/sale_date_spec.rb | 4 -- .../sales/pages/shared_ownership_type_spec.rb | 23 ++-------- .../sales/questions/buyer_interview_spec.rb | 28 ----------- .../form/sales/questions/buyer_live_spec.rb | 26 ++--------- .../sales/questions/created_by_id_spec.rb | 12 ----- .../sales/questions/joint_purchase_spec.rb | 28 ----------- .../questions/managing_organisation_spec.rb | 12 ----- .../questions/number_joint_buyers_spec.rb | 12 ----- .../questions/outright_ownership_type_spec.rb | 8 ---- .../questions/owning_organisation_id_spec.rb | 12 ----- .../questions/shared_ownership_type_spec.rb | 46 ++++--------------- 21 files changed, 23 insertions(+), 244 deletions(-) diff --git a/config/locales/forms/2023/sales/setup.en.yml b/config/locales/forms/2023/sales/setup.en.yml index bed55803a..8fddb5a45 100644 --- a/config/locales/forms/2023/sales/setup.en.yml +++ b/config/locales/forms/2023/sales/setup.en.yml @@ -89,12 +89,12 @@ en: joint_purchase: page_header: "" check_answer_label: "Buyers interviewed in person?" - hint_text: "You should still try to answer all questions even if the buyers weren't interviewed in person" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" not_joint_purchase: page_header: "" check_answer_label: "Buyer interviewed in person?" - hint_text: "You should still try to answer all questions even if the buyer wasn't interviewed in person" + hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person" question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" privacynotice: diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml index 2434817f1..2f7ab0620 100644 --- a/config/locales/forms/2024/sales/setup.en.yml +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -89,12 +89,12 @@ en: joint_purchase: page_header: "" check_answer_label: "Buyers interviewed in person?" - hint_text: "You should still try to answer all questions even if the buyers weren't interviewed in person" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" not_joint_purchase: page_header: "" check_answer_label: "Buyer interviewed in person?" - hint_text: "You should still try to answer all questions even if the buyer wasn't interviewed in person" + hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person" question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" privacynotice: diff --git a/spec/models/form/sales/pages/buyer_company_spec.rb b/spec/models/form/sales/pages/buyer_company_spec.rb index 6f26a731c..83cca76a4 100644 --- a/spec/models/form/sales/pages/buyer_company_spec.rb +++ b/spec/models/form/sales/pages/buyer_company_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyerCompany, type: :model do expect(page.id).to eq("buyer_company") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_live_spec.rb b/spec/models/form/sales/pages/buyer_live_spec.rb index a26b265ec..dd237214c 100644 --- a/spec/models/form/sales/pages/buyer_live_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_spec.rb @@ -1,15 +1,17 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::BuyerLive, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_after_2024?).and_return(true) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/pages/joint_purchase_spec.rb b/spec/models/form/sales/pages/joint_purchase_spec.rb index 6c0f6a4f5..4ccefd03d 100644 --- a/spec/models/form/sales/pages/joint_purchase_spec.rb +++ b/spec/models/form/sales/pages/joint_purchase_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::JointPurchase, type: :model do expect(page.id).to eq("joint_purchase") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/managing_organisation_spec.rb b/spec/models/form/sales/pages/managing_organisation_spec.rb index aacb7cccb..ea90add64 100644 --- a/spec/models/form/sales/pages/managing_organisation_spec.rb +++ b/spec/models/form/sales/pages/managing_organisation_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::ManagingOrganisation, type: :model do expect(page.id).to eq("managing_organisation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/number_joint_buyers_spec.rb b/spec/models/form/sales/pages/number_joint_buyers_spec.rb index c48fc654b..50bbd7c5f 100644 --- a/spec/models/form/sales/pages/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/pages/number_joint_buyers_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::NumberJointBuyers, type: :model do expect(page.id).to eq("number_joint_buyers") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/outright_ownership_type_spec.rb b/spec/models/form/sales/pages/outright_ownership_type_spec.rb index a080d148d..b308f23f1 100644 --- a/spec/models/form/sales/pages/outright_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/outright_ownership_type_spec.rb @@ -29,22 +29,4 @@ RSpec.describe Form::Sales::Pages::OutrightOwnershipType, type: :model do "ownershipsch" => 3, }]) end - - describe "headers" do - context "when the form year is 2023/24" do - let(:start_date) { Time.zone.local(2023, 4, 8) } - - it "has the correct header" do - expect(page.header).to eq("Type of outright sale") - end - end - - context "when the form is before the year 2023/24" do - let(:start_date) { Time.zone.local(2022, 4, 8) } - - it "does not have a page header" do - expect(page.header).to eq(nil) - end - end - end end diff --git a/spec/models/form/sales/pages/ownership_scheme_spec.rb b/spec/models/form/sales/pages/ownership_scheme_spec.rb index 5e970be8a..b9f3c5ae9 100644 --- a/spec/models/form/sales/pages/ownership_scheme_spec.rb +++ b/spec/models/form/sales/pages/ownership_scheme_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::OwnershipScheme, type: :model do expect(page.id).to eq("ownership_scheme") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/owning_organisation_spec.rb b/spec/models/form/sales/pages/owning_organisation_spec.rb index 8ed90ca93..3a9f1a900 100644 --- a/spec/models/form/sales/pages/owning_organisation_spec.rb +++ b/spec/models/form/sales/pages/owning_organisation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::OwningOrganisation, type: :model do expect(page.id).to eq("owning_organisation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/sale_date_spec.rb b/spec/models/form/sales/pages/sale_date_spec.rb index 63be88b02..c606d332a 100644 --- a/spec/models/form/sales/pages/sale_date_spec.rb +++ b/spec/models/form/sales/pages/sale_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SaleDate, type: :model do expect(page.id).to eq("completion_date") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil 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 33d996a2b..d12c49b57 100644 --- a/spec/models/form/sales/pages/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_type_spec.rb @@ -1,30 +1,13 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::SharedOwnershipType, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } - 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 - context "when form is after the year 2023/24" do - let(:start_date) { Time.zone.local(2023, 4, 8) } - - it "has the correct header" do - expect(page.header).to eq("Type of shared ownership sale") - end - end - - context "when form is before the year 2023/24" do - let(:start_date) { Time.zone.local(2022, 2, 8) } - - it "has the correct header" do - expect(page.header).to eq(nil) - end - end - end + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_after_2024?: true)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb index 0cd58eae6..df5dcd0be 100644 --- a/spec/models/form/sales/questions/buyer_interview_spec.rb +++ b/spec/models/form/sales/questions/buyer_interview_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do expect(question.id).to eq("noint") end - it "has the correct header" do - expect(question.header).to eq("Was the buyer interviewed for any of the answers you will provide on this log?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer interviewed in person?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,30 +23,10 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You should still try to answer all questions even if the buyer wasn’t interviewed in person") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Yes" }, "1" => { "value" => "No" }, }) end - - context "with joint purchase" do - subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } - - it "has the correct header" do - expect(question.header).to eq("Were the buyers interviewed for any of the answers you will provide on this log?") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("You should still try to answer all questions even if the buyers weren’t interviewed in person") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyers interviewed in person?") - end - end end diff --git a/spec/models/form/sales/questions/buyer_live_spec.rb b/spec/models/form/sales/questions/buyer_live_spec.rb index 8b7d9ce1f..12dfc8be6 100644 --- a/spec/models/form/sales/questions/buyer_live_spec.rb +++ b/spec/models/form/sales/questions/buyer_live_spec.rb @@ -1,16 +1,18 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } let(:question_definition) { nil } let(:page) { instance_double(Form::Page) } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_after_2024?).and_return(true) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -23,10 +25,6 @@ RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do expect(question.id).to eq("buylivein") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyers living in property") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -41,20 +39,4 @@ RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do "2" => { "value" => "No" }, }) end - - context "with 2023/24 form" do - it "has the correct header" do - expect(question.header).to eq("Will the buyers live in the property?") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct header" do - expect(question.header).to eq("Will any buyers live in the property?") - end - end end diff --git a/spec/models/form/sales/questions/created_by_id_spec.rb b/spec/models/form/sales/questions/created_by_id_spec.rb index b5294df44..0c21a21c8 100644 --- a/spec/models/form/sales/questions/created_by_id_spec.rb +++ b/spec/models/form/sales/questions/created_by_id_spec.rb @@ -17,22 +17,10 @@ RSpec.describe Form::Sales::Questions::CreatedById, type: :model do expect(question.id).to eq("assigned_to_id") end - it "has the correct header" do - expect(question.header).to eq("Which user are you creating this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Log owner") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "is marked as derived" do expect(question.derived?(nil)).to be true end diff --git a/spec/models/form/sales/questions/joint_purchase_spec.rb b/spec/models/form/sales/questions/joint_purchase_spec.rb index 164ad0e9b..082a2d954 100644 --- a/spec/models/form/sales/questions/joint_purchase_spec.rb +++ b/spec/models/form/sales/questions/joint_purchase_spec.rb @@ -22,14 +22,6 @@ RSpec.describe Form::Sales::Questions::JointPurchase, type: :model do expect(question.id).to eq("jointpur") end - it "has the correct header" do - expect(question.header).to eq("Is this a joint purchase?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Joint purchase") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,24 +36,4 @@ RSpec.describe Form::Sales::Questions::JointPurchase, type: :model do "2" => { "value" => "No" }, }) end - - context "with collection year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the blank hint_text" do - expect(question.hint_text).to be_nil - end - end - - context "with collection year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is where two or more people are named as legal owners of the property after the purchase") - end - end end diff --git a/spec/models/form/sales/questions/managing_organisation_spec.rb b/spec/models/form/sales/questions/managing_organisation_spec.rb index 2ebbf5e01..e59d5c821 100644 --- a/spec/models/form/sales/questions/managing_organisation_spec.rb +++ b/spec/models/form/sales/questions/managing_organisation_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Sales::Questions::ManagingOrganisation, type: :model do expect(question.id).to eq("managing_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation is reporting this sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Reported by") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "#displayed_answer_options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/sales/questions/number_joint_buyers_spec.rb b/spec/models/form/sales/questions/number_joint_buyers_spec.rb index efece2ecc..e02d271c2 100644 --- a/spec/models/form/sales/questions/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/questions/number_joint_buyers_spec.rb @@ -21,14 +21,6 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do expect(question.id).to eq("jointmore") end - it "has the correct header" do - expect(question.header).to eq("Are there more than 2 joint buyers of this property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("More than 2 joint buyers") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -37,10 +29,6 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("You should still try to answer all questions even if the buyers weren’t interviewed in person") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/outright_ownership_type_spec.rb b/spec/models/form/sales/questions/outright_ownership_type_spec.rb index 11e0b7b10..0ee30556c 100644 --- a/spec/models/form/sales/questions/outright_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/outright_ownership_type_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Sales::Questions::OutrightOwnershipType, type: :model do expect(question.id).to eq("type") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of outright sale") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,10 +38,6 @@ RSpec.describe Form::Sales::Questions::OutrightOwnershipType, type: :model do }) end - it "has the correct header" do - expect(question.header).to eq("What is the type of outright sale?") - end - describe "partial guidance" do context "when the form is for year 2023/24" do let(:start_date) { Time.zone.local(2023, 4, 8) } diff --git a/spec/models/form/sales/questions/owning_organisation_id_spec.rb b/spec/models/form/sales/questions/owning_organisation_id_spec.rb index bc6fad6e5..63f3601f2 100644 --- a/spec/models/form/sales/questions/owning_organisation_id_spec.rb +++ b/spec/models/form/sales/questions/owning_organisation_id_spec.rb @@ -26,22 +26,10 @@ RSpec.describe Form::Sales::Questions::OwningOrganisationId, type: :model do expect(question.id).to eq("owning_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation owns this log?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Owning organisation") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "answer options" do let(:options) { { "" => "Select an option" } } 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 4771241e5..19cae6e89 100644 --- a/spec/models/form/sales/questions/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_type_spec.rb @@ -1,17 +1,19 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } let(:question_definition) { nil } - let(:start_date) { Time.zone.local(2022, 4, 1) } + let(:start_date) { current_collection_start_date } let(:form) { instance_double(Form, start_date:) } 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) + allow(form).to receive(:start_year_after_2024?).and_return(true) end it "has correct page" do @@ -22,14 +24,6 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do expect(question.id).to eq("type") end - it "has the correct header" do - expect(question.header).to eq("What is the type of shared ownership sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of shared ownership sale") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -38,33 +32,13 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("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 - - context "when form start date is 2022/23" do - let(:start_date) { Time.zone.local(2022, 4, 1) } - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "2" => { "value" => "Shared Ownership" }, - "24" => { "value" => "Old Persons Shared Ownership" }, - "18" => { "value" => "Social HomeBuy (shared ownership purchase)" }, - "16" => { "value" => "Home Ownership for people with Long-Term Disabilities (HOLD)" }, - "28" => { "value" => "Rent to Buy - Shared Ownership" }, - "31" => { "value" => "Right to Shared Ownership" }, - "30" => { "value" => "Shared Ownership - 2021 model lease" }, - }) - end - - it "does not show a top_guidance_partial" do - expect(question.top_guidance_partial).to eq(nil) - end - end - context "when form start date is 2023/24" do let(:start_date) { Time.zone.local(2023, 4, 2) } + before do + allow(form).to receive(:start_year_after_2024?).and_return(false) + end + it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Shared Ownership (old model lease)" }, @@ -91,9 +65,5 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do 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 From b48f5ab42204effc2887387fc827f3480bc40fd7 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 7 Oct 2024 11:40:17 +0100 Subject: [PATCH 10/45] And again... --- .../form/sales/questions/number_joint_buyers_spec.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/spec/models/form/sales/questions/number_joint_buyers_spec.rb b/spec/models/form/sales/questions/number_joint_buyers_spec.rb index e02d271c2..9529b3aac 100644 --- a/spec/models/form/sales/questions/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/questions/number_joint_buyers_spec.rb @@ -36,14 +36,4 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do "3" => { "value" => "Don’t know" }, }) end - - context "with 2024 form" do - before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) - end - - it "has no hint_text" do - expect(question.hint_text).to be_nil - end - end end From dc2c7d5d8df6e21e2ec228dea1abeccb9eb0ff9f Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 7 Oct 2024 11:52:44 +0100 Subject: [PATCH 11/45] ...and again --- .../form/sales/questions/privacy_notice_spec.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/spec/models/form/sales/questions/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb index 9242804ae..b862c9ff0 100644 --- a/spec/models/form/sales/questions/privacy_notice_spec.rb +++ b/spec/models/form/sales/questions/privacy_notice_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do expect(question.id).to eq("privacynotice") end - it "has the correct header" do - expect(question.header).to eq("Declaration") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer has seen the privacy notice?") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end @@ -39,10 +31,6 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - context "when the form year is before 2024" do before do allow(form).to receive(:start_year_after_2024?).and_return(false) From f359ac326a4befa477fbfa2e0de7bcd51c46f7b0 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 7 Oct 2024 17:32:27 +0100 Subject: [PATCH 12/45] Tidy --- app/models/form/page.rb | 8 +++++--- app/models/form/question.rb | 16 +++++++--------- app/models/form/sales/pages/buyer_company.rb | 1 - app/models/form/sales/pages/buyer_live.rb | 1 - app/models/form/sales/pages/created_by.rb | 1 - .../sales/pages/discounted_ownership_type.rb | 1 - app/models/form/sales/pages/joint_purchase.rb | 1 - .../form/sales/pages/managing_organisation.rb | 1 - .../form/sales/pages/number_joint_buyers.rb | 1 - .../form/sales/pages/outright_ownership_type.rb | 2 +- app/models/form/sales/pages/ownership_scheme.rb | 1 - .../form/sales/pages/owning_organisation.rb | 1 - app/models/form/sales/pages/privacy_notice.rb | 2 +- app/models/form/sales/pages/purchaser_code.rb | 1 - app/models/form/sales/pages/sale_date.rb | 1 - .../form/sales/pages/shared_ownership_type.rb | 1 - app/models/form/sales/questions/buyer_company.rb | 1 - app/models/form/sales/questions/buyer_live.rb | 1 - app/models/form/sales/questions/created_by_id.rb | 1 - .../form/sales/questions/joint_purchase.rb | 1 - .../sales/questions/managing_organisation.rb | 1 - .../form/sales/questions/number_joint_buyers.rb | 1 - .../form/sales/questions/other_ownership_type.rb | 3 +-- .../sales/questions/outright_ownership_type.rb | 3 +-- .../form/sales/questions/ownership_scheme.rb | 1 - .../sales/questions/owning_organisation_id.rb | 1 - .../form/sales/questions/purchaser_code.rb | 1 - app/models/form/sales/questions/sale_date.rb | 1 - config/locales/forms/2024/sales/setup.en.yml | 4 ++-- 29 files changed, 18 insertions(+), 42 deletions(-) diff --git a/app/models/form/page.rb b/app/models/form/page.rb index bc9edefe0..465f21ee7 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -24,10 +24,12 @@ class Form::Page delegate :form, to: :subsection - def header - return @header if @copy_key.nil? + def copy_key + @copy_key ||= "#{form.type}.#{subsection.id}.#{questions[0].id}" + end - I18n.t("forms.#{form.start_date.year}.#{@copy_key}.page_header") + def header + @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.page_header") end def routed_to?(log, _current_user) diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 57ed70e66..065639c98 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -48,22 +48,20 @@ class Form::Question delegate :subsection, to: :page delegate :form, to: :subsection - def check_answer_label - return @check_answer_label if @copy_key.nil? + def copy_key + @copy_key ||= "#{form.type}.#{subsection.id}.#{id}" + end - I18n.t("forms.#{form.start_date.year}.#{@copy_key}.check_answer_label") + def check_answer_label + @check_answer_label ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.check_answer_label") end def header - return @header if @copy_key.nil? - - I18n.t("forms.#{form.start_date.year}.#{@copy_key}.question_text") + @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.question_text") end def hint_text - return @hint_text if @copy_key.nil? - - I18n.t("forms.#{form.start_date.year}.#{@copy_key}.hint_text") + @hint_text ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.hint_text") end def answer_label(log, user = nil) diff --git a/app/models/form/sales/pages/buyer_company.rb b/app/models/form/sales/pages/buyer_company.rb index cc2d962fe..dbe1afcec 100644 --- a/app/models/form/sales/pages/buyer_company.rb +++ b/app/models/form/sales/pages/buyer_company.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::BuyerCompany < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_company" - @copy_key = "sales.setup.companybuy" @depends_on = [{ "outright_sale?" => true, }] diff --git a/app/models/form/sales/pages/buyer_live.rb b/app/models/form/sales/pages/buyer_live.rb index 6606f8ed4..d0b772355 100644 --- a/app/models/form/sales/pages/buyer_live.rb +++ b/app/models/form/sales/pages/buyer_live.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::BuyerLive < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_live" - @copy_key = "sales.setup.buylivein" @depends_on = [{ "companybuy" => 2, }] diff --git a/app/models/form/sales/pages/created_by.rb b/app/models/form/sales/pages/created_by.rb index b84764804..e68fc6a30 100644 --- a/app/models/form/sales/pages/created_by.rb +++ b/app/models/form/sales/pages/created_by.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::CreatedBy < ::Form::Page def initialize(id, hsh, subsection) super @id = "assigned_to" - @copy_key = "sales.setup.assigned_to_id" end def questions diff --git a/app/models/form/sales/pages/discounted_ownership_type.rb b/app/models/form/sales/pages/discounted_ownership_type.rb index 346ad4467..5998e6019 100644 --- a/app/models/form/sales/pages/discounted_ownership_type.rb +++ b/app/models/form/sales/pages/discounted_ownership_type.rb @@ -3,7 +3,6 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page super @id = "discounted_ownership_type" @copy_key = "sales.setup.type.discounted_ownership" - @header = header @depends_on = [{ "ownershipsch" => 2, }] diff --git a/app/models/form/sales/pages/joint_purchase.rb b/app/models/form/sales/pages/joint_purchase.rb index e3b0156b7..bec7c88c1 100644 --- a/app/models/form/sales/pages/joint_purchase.rb +++ b/app/models/form/sales/pages/joint_purchase.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::JointPurchase < ::Form::Page def initialize(id, hsh, subsection) super @id = "joint_purchase" - @copy_key = "sales.setup.jointpur" @depends_on = [ { "ownershipsch" => 1 }, { "ownershipsch" => 2 }, diff --git a/app/models/form/sales/pages/managing_organisation.rb b/app/models/form/sales/pages/managing_organisation.rb index bbb046f6b..3d8e59383 100644 --- a/app/models/form/sales/pages/managing_organisation.rb +++ b/app/models/form/sales/pages/managing_organisation.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::ManagingOrganisation < ::Form::Page def initialize(id, hsh, subsection) super @id = "managing_organisation" - @copy_key = "sales.setup.managing_organisation_id" end def questions diff --git a/app/models/form/sales/pages/number_joint_buyers.rb b/app/models/form/sales/pages/number_joint_buyers.rb index 456fb61e9..3a8c3475d 100644 --- a/app/models/form/sales/pages/number_joint_buyers.rb +++ b/app/models/form/sales/pages/number_joint_buyers.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::NumberJointBuyers < ::Form::Page def initialize(id, hsh, subsection) super @id = "number_joint_buyers" - @copy_key = "sales.setup.jointmore" @depends_on = [{ "joint_purchase?" => true, }] diff --git a/app/models/form/sales/pages/outright_ownership_type.rb b/app/models/form/sales/pages/outright_ownership_type.rb index 5d714153b..35194102a 100644 --- a/app/models/form/sales/pages/outright_ownership_type.rb +++ b/app/models/form/sales/pages/outright_ownership_type.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "outright_ownership_type" - @header = header + @copy_key = "sales.setup.type.outright_ownership" @depends_on = [{ "ownershipsch" => 3, }] diff --git a/app/models/form/sales/pages/ownership_scheme.rb b/app/models/form/sales/pages/ownership_scheme.rb index 6e1ca5cfe..d92e56600 100644 --- a/app/models/form/sales/pages/ownership_scheme.rb +++ b/app/models/form/sales/pages/ownership_scheme.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::OwnershipScheme < ::Form::Page def initialize(id, hsh, subsection) super @id = "ownership_scheme" - @copy_key = "sales.setup.ownershipsch" end def questions diff --git a/app/models/form/sales/pages/owning_organisation.rb b/app/models/form/sales/pages/owning_organisation.rb index e3b093b83..f0c9e4e68 100644 --- a/app/models/form/sales/pages/owning_organisation.rb +++ b/app/models/form/sales/pages/owning_organisation.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::OwningOrganisation < ::Form::Page def initialize(id, hsh, subsection) super @id = "owning_organisation" - @copy_key = "sales.setup.owning_organisation_id" end def questions diff --git a/app/models/form/sales/pages/privacy_notice.rb b/app/models/form/sales/pages/privacy_notice.rb index 1bd9e22de..cf6a7bbbc 100644 --- a/app/models/form/sales/pages/privacy_notice.rb +++ b/app/models/form/sales/pages/privacy_notice.rb @@ -1,7 +1,7 @@ class Form::Sales::Pages::PrivacyNotice < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) - @header = "Ministry of Housing, Communities and Local Government privacy notice" + @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @joint_purchase = joint_purchase end diff --git a/app/models/form/sales/pages/purchaser_code.rb b/app/models/form/sales/pages/purchaser_code.rb index ec61d50dd..8282453ad 100644 --- a/app/models/form/sales/pages/purchaser_code.rb +++ b/app/models/form/sales/pages/purchaser_code.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::PurchaserCode < ::Form::Page def initialize(id, hsh, subsection) super @id = "purchaser_code" - @copy_key = "sales.setup.purchid" end def questions diff --git a/app/models/form/sales/pages/sale_date.rb b/app/models/form/sales/pages/sale_date.rb index 3a9432623..036e04907 100644 --- a/app/models/form/sales/pages/sale_date.rb +++ b/app/models/form/sales/pages/sale_date.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::SaleDate < ::Form::Page def initialize(id, hsh, subsection) super @id = "completion_date" - @copy_key = "sales.setup.saledate" end def questions diff --git a/app/models/form/sales/pages/shared_ownership_type.rb b/app/models/form/sales/pages/shared_ownership_type.rb index 304c58730..a156abb17 100644 --- a/app/models/form/sales/pages/shared_ownership_type.rb +++ b/app/models/form/sales/pages/shared_ownership_type.rb @@ -3,7 +3,6 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page super @id = "shared_ownership_type" @copy_key = "sales.setup.type.shared_ownership" - @header = header @depends_on = [{ "ownershipsch" => 1, }] diff --git a/app/models/form/sales/questions/buyer_company.rb b/app/models/form/sales/questions/buyer_company.rb index 9ca551e70..a5dc69d8d 100644 --- a/app/models/form/sales/questions/buyer_company.rb +++ b/app/models/form/sales/questions/buyer_company.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question def initialize(id, hsh, page) super @id = "companybuy" - @copy_key = "sales.setup.companybuy" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/buyer_live.rb b/app/models/form/sales/questions/buyer_live.rb index 794b3c7bc..315329088 100644 --- a/app/models/form/sales/questions/buyer_live.rb +++ b/app/models/form/sales/questions/buyer_live.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::BuyerLive < ::Form::Question def initialize(id, hsh, page) super @id = "buylivein" - @copy_key = "sales.setup.buylivein" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/created_by_id.rb b/app/models/form/sales/questions/created_by_id.rb index f4a40daff..516afd2bc 100644 --- a/app/models/form/sales/questions/created_by_id.rb +++ b/app/models/form/sales/questions/created_by_id.rb @@ -4,7 +4,6 @@ class Form::Sales::Questions::CreatedById < ::Form::Question def initialize(id, hsh, page) super @id = "assigned_to_id" - @copy_key = "sales.setup.assigned_to_id" @derived = true @type = "select" end diff --git a/app/models/form/sales/questions/joint_purchase.rb b/app/models/form/sales/questions/joint_purchase.rb index 9e47ca7a3..7e876a4cc 100644 --- a/app/models/form/sales/questions/joint_purchase.rb +++ b/app/models/form/sales/questions/joint_purchase.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question def initialize(id, hsh, page) super @id = "jointpur" - @copy_key = "sales.setup.jointpur" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/managing_organisation.rb b/app/models/form/sales/questions/managing_organisation.rb index f934a0cc7..17884687f 100644 --- a/app/models/form/sales/questions/managing_organisation.rb +++ b/app/models/form/sales/questions/managing_organisation.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question def initialize(id, hsh, page) super @id = "managing_organisation_id" - @copy_key = "sales.setup.managing_organisation_id" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/number_joint_buyers.rb b/app/models/form/sales/questions/number_joint_buyers.rb index 147f78ef5..d86e37a93 100644 --- a/app/models/form/sales/questions/number_joint_buyers.rb +++ b/app/models/form/sales/questions/number_joint_buyers.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question def initialize(id, hsh, page) super @id = "jointmore" - @copy_key = "sales.setup.jointmore" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/other_ownership_type.rb b/app/models/form/sales/questions/other_ownership_type.rb index a6e98d784..84742b7ea 100644 --- a/app/models/form/sales/questions/other_ownership_type.rb +++ b/app/models/form/sales/questions/other_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::OtherOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "othtype" - @check_answer_label = "Type of other sale" - @header = "What type of sale is it?" + @copy_key = "sales.setup.type.outright_ownership.othtype" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/outright_ownership_type.rb b/app/models/form/sales/questions/outright_ownership_type.rb index 8831367b6..f56b63d78 100644 --- a/app/models/form/sales/questions/outright_ownership_type.rb +++ b/app/models/form/sales/questions/outright_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of outright sale" - @header = "What is the type of outright sale?" + @copy_key = "sales.setup.type.outright_ownership.type" @type = "radio" @top_guidance_partial = guidance_partial @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 38a97e824..6b33a2566 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question def initialize(id, hsh, page) super @id = "ownershipsch" - @copy_key = "sales.setup.ownershipsch" @type = "radio" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/owning_organisation_id.rb b/app/models/form/sales/questions/owning_organisation_id.rb index adf777b48..aacccecd3 100644 --- a/app/models/form/sales/questions/owning_organisation_id.rb +++ b/app/models/form/sales/questions/owning_organisation_id.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question def initialize(id, hsh, page) super @id = "owning_organisation_id" - @copy_key = "sales.setup.owning_organisation_id" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/purchaser_code.rb b/app/models/form/sales/questions/purchaser_code.rb index 527dd659a..fd3b126e9 100644 --- a/app/models/form/sales/questions/purchaser_code.rb +++ b/app/models/form/sales/questions/purchaser_code.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question def initialize(id, hsh, page) super @id = "purchid" - @copy_key = "sales.setup.purchid" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/sale_date.rb b/app/models/form/sales/questions/sale_date.rb index f969c32f2..00f0c86dd 100644 --- a/app/models/form/sales/questions/sale_date.rb +++ b/app/models/form/sales/questions/sale_date.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::SaleDate < ::Form::Question def initialize(id, hsh, page) super @id = "saledate" - @copy_key = "sales.setup.saledate" @type = "date" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml index 2f7ab0620..b88691a0d 100644 --- a/config/locales/forms/2024/sales/setup.en.yml +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -99,12 +99,12 @@ en: privacynotice: joint_purchase: - page_header: "" + page_header: "Ministry of Housing, Communities and Local Government privacy notice" check_answer_label: "Buyers have seen the privacy notice?" hint_text: "" question_text: "Declaration" not_joint_purchase: - page_header: "" + page_header: "Ministry of Housing, Communities and Local Government privacy notice" check_answer_label: "Buyer has seen the privacy notice?" hint_text: "" question_text: "Declaration" From 713fb83c7a17b09c37c1608d07ec7e681bf93fd9 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Tue, 8 Oct 2024 09:41:09 +0100 Subject: [PATCH 13/45] Handle when some text is undefined in questions not yet using translation files --- app/models/form/page.rb | 2 +- app/models/form/question.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/form/page.rb b/app/models/form/page.rb index 465f21ee7..7a5c4bf87 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -29,7 +29,7 @@ class Form::Page end def header - @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.page_header") + @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.page_header", default: "") end def routed_to?(log, _current_user) diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 065639c98..6b3098304 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -53,15 +53,15 @@ class Form::Question end def check_answer_label - @check_answer_label ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.check_answer_label") + @check_answer_label ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.check_answer_label", default: "") end def header - @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.question_text") + @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.question_text", default: "") end def hint_text - @hint_text ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.hint_text") + @hint_text ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.hint_text", default: "") end def answer_label(log, user = nil) From 9f9d75513136fb66597fdc91f7d14bb6e56e2f1b Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 9 Oct 2024 11:35:00 +0100 Subject: [PATCH 14/45] Remove text tests from pages and questions --- .../lettings/pages/address_fallback_spec.rb | 4 -- .../lettings/pages/address_matcher_spec.rb | 4 -- .../form/lettings/pages/address_spec.rb | 4 -- .../care_home_charges_value_check_spec.rb | 4 -- .../form/lettings/pages/created_by_spec.rb | 4 -- ...t_household_person_age_value_check_spec.rb | 4 -- ...gnant_household_person_value_check_spec.rb | 4 -- ...ime_property_let_as_social_housing_spec.rb | 4 -- ...ead_tenant_ethnic_background_white_spec.rb | 4 -- .../form/lettings/pages/location_spec.rb | 4 -- .../pages/managing_organisation_spec.rb | 4 -- .../pages/max_rent_value_check_spec.rb | 4 -- .../pages/min_rent_value_check_spec.rb | 4 -- .../multiple_partners_value_check_spec.rb | 4 -- .../form/lettings/pages/needs_type_spec.rb | 4 -- .../pages/net_income_value_check_spec.rb | 4 -- .../lettings/pages/no_address_found_spec.rb | 4 -- ...t_household_person_age_value_check_spec.rb | 4 -- ...gnant_household_person_value_check_spec.rb | 4 -- .../pages/partner_under16_value_check_spec.rb | 4 -- .../form/lettings/pages/person_age_spec.rb | 4 -- .../pages/person_gender_identity_spec.rb | 4 -- .../form/lettings/pages/person_known_spec.rb | 4 -- ...person_over_retirement_value_check_spec.rb | 4 -- .../pages/person_relationship_to_lead_spec.rb | 4 -- ...erson_under_retirement_value_check_spec.rb | 4 -- .../pages/person_working_situation_spec.rb | 4 -- ...previous_housing_situation_renewal_spec.rb | 4 -- .../pages/previous_housing_situation_spec.rb | 4 -- .../pages/previous_local_authority_spec.rb | 4 -- .../lettings/pages/previous_postcode_spec.rb | 4 -- .../pages/property_local_authority_spec.rb | 4 -- .../property_number_of_times_relet_spec.rb | 4 -- .../lettings/pages/property_reference_spec.rb | 4 -- .../property_wheelchair_accessible_spec.rb | 4 -- .../form/lettings/pages/renewal_spec.rb | 4 -- .../form/lettings/pages/rent_type_spec.rb | 4 -- .../models/form/lettings/pages/scheme_spec.rb | 4 -- .../pages/sheltered_accommodation_spec.rb | 4 -- .../pages/starter_tenancy_type_spec.rb | 4 -- .../form/lettings/pages/stock_owner_spec.rb | 4 -- .../pages/tenancy_length_periodic_spec.rb | 4 -- .../lettings/pages/tenancy_length_spec.rb | 4 -- .../lettings/pages/tenancy_start_date_spec.rb | 4 -- .../form/lettings/pages/tenancy_type_spec.rb | 4 -- .../form/lettings/pages/tenant_code_spec.rb | 4 -- .../lettings/pages/uprn_confirmation_spec.rb | 4 -- .../lettings/pages/uprn_selection_spec.rb | 4 -- spec/models/form/lettings/pages/uprn_spec.rb | 4 -- .../form/lettings/pages/void_date_spec.rb | 4 -- .../address_line1_for_address_matcher_spec.rb | 12 ----- .../lettings/questions/address_line1_spec.rb | 12 ----- .../lettings/questions/address_line2_spec.rb | 12 ----- .../lettings/questions/age1_known_spec.rb | 24 --------- .../form/lettings/questions/age_known_spec.rb | 16 ------ .../form/lettings/questions/age_spec.rb | 26 ---------- .../form/lettings/questions/beds_spec.rb | 22 -------- .../care_home_charges_value_check_spec.rb | 12 ----- .../form/lettings/questions/county_spec.rb | 12 ----- .../lettings/questions/created_by_id_spec.rb | 12 ----- .../lettings/questions/declaration_spec.rb | 12 ----- .../lettings/questions/details_known_spec.rb | 20 ------- .../lettings/questions/ethnic_white_spec.rb | 16 ------ .../questions/gender_identity1_spec.rb | 28 ---------- .../models/form/lettings/questions/hb_spec.rb | 24 --------- .../form/lettings/questions/homeless_spec.rb | 8 --- .../questions/housingneeds_other_spec.rb | 8 --- .../questions/irproduct_other_spec.rb | 8 --- .../lettings/questions/is_carehome_spec.rb | 8 --- .../form/lettings/questions/joint_spec.rb | 22 -------- .../form/lettings/questions/layear_spec.rb | 8 --- .../questions/letting_allocation_spec.rb | 8 --- .../lettings/questions/location_id_spec.rb | 18 ------- .../questions/managing_organisation_spec.rb | 12 ----- .../questions/max_rent_value_check_spec.rb | 12 ----- .../questions/min_rent_value_check_spec.rb | 12 ----- .../multiple_partners_value_check_spec.rb | 12 ----- .../questions/nationality_all_group_spec.rb | 12 ----- .../questions/nationality_all_spec.rb | 12 ----- .../lettings/questions/nationality_spec.rb | 12 ----- .../lettings/questions/needs_type_spec.rb | 8 --- .../questions/no_address_found_spec.rb | 12 ----- .../form/lettings/questions/offered_spec.rb | 12 ----- .../partner_under16_value_check_spec.rb | 12 ----- .../form/lettings/questions/period_spec.rb | 4 -- .../questions/person_gender_identity_spec.rb | 36 ------------- .../questions/person_relationship_spec.rb | 20 ------- .../person_working_situation_spec.rb | 20 ------- .../postcode_for_address_matcher_spec.rb | 12 ----- .../postcode_for_full_address_spec.rb | 12 ----- .../form/lettings/questions/ppcodenk_spec.rb | 24 --------- .../questions/previous_la_known_spec.rb | 24 --------- .../questions/previous_let_type_spec.rb | 16 ------ .../questions/previous_tenure_renewal_spec.rb | 13 ----- .../questions/previous_tenure_spec.rb | 12 ----- .../questions/property_reference_spec.rb | 12 ----- .../lettings/questions/reason_renewal_spec.rb | 12 ----- .../form/lettings/questions/reason_spec.rb | 16 ------ .../lettings/questions/reasonpref_spec.rb | 24 --------- .../lettings/questions/referral_prp_spec.rb | 12 ----- .../form/lettings/questions/referral_spec.rb | 12 ----- .../referral_supported_housing_prp_spec.rb | 12 ----- .../referral_supported_housing_spec.rb | 12 ----- .../form/lettings/questions/renewal_spec.rb | 26 ---------- .../form/lettings/questions/rent_type_spec.rb | 12 ----- .../form/lettings/questions/rsnvac_spec.rb | 8 --- .../form/lettings/questions/scheme_id_spec.rb | 29 ----------- .../form/lettings/questions/sheltered_spec.rb | 12 ----- .../questions/starter_tenancy_type_spec.rb | 24 --------- .../lettings/questions/startertenancy_spec.rb | 37 ------------- .../lettings/questions/stock_owner_spec.rb | 12 ----- .../tenancy_length_affordable_rent_spec.rb | 22 -------- .../tenancy_length_intermediate_rent_spec.rb | 22 -------- .../questions/tenancy_length_periodic_spec.rb | 12 ----- .../lettings/questions/tenancy_length_spec.rb | 12 ----- .../lettings/questions/tenancy_other_spec.rb | 12 ----- .../questions/tenancy_start_date_spec.rb | 8 --- .../lettings/questions/tenancy_type_spec.rb | 12 ----- .../lettings/questions/tenant_code_spec.rb | 12 ----- .../lettings/questions/town_or_city_spec.rb | 12 ----- .../questions/uprn_confirmation_spec.rb | 12 ----- .../lettings/questions/uprn_known_spec.rb | 16 ------ .../lettings/questions/uprn_selection_spec.rb | 12 ----- .../form/lettings/questions/uprn_spec.rb | 12 ----- .../form/lettings/questions/voiddate_spec.rb | 8 --- .../form/lettings/questions/waityear_spec.rb | 16 ------ .../lettings/questions/wheelchair_spec.rb | 22 -------- .../pages/about_price_value_check_spec.rb | 4 -- .../form/sales/pages/about_staircase_spec.rb | 4 -- .../form/sales/pages/address_fallback_spec.rb | 4 -- .../form/sales/pages/address_matcher_spec.rb | 4 -- spec/models/form/sales/pages/address_spec.rb | 4 -- spec/models/form/sales/pages/age1_spec.rb | 4 -- spec/models/form/sales/pages/age2_spec.rb | 4 -- .../form/sales/pages/armed_forces_spec.rb | 4 -- .../sales/pages/armed_forces_spouse_spec.rb | 4 -- .../buyer1_ethnic_background_arab_spec.rb | 4 -- .../buyer1_ethnic_background_asian_spec.rb | 4 -- .../buyer1_ethnic_background_black_spec.rb | 4 -- .../buyer1_ethnic_background_mixed_spec.rb | 4 -- .../buyer1_ethnic_background_white_spec.rb | 4 -- .../sales/pages/buyer1_ethnic_group_spec.rb | 4 -- .../buyer1_income_max_value_check_spec.rb | 4 -- .../buyer1_income_min_value_check_spec.rb | 4 -- .../form/sales/pages/buyer1_income_spec.rb | 4 -- .../pages/buyer1_live_in_property_spec.rb | 4 -- .../form/sales/pages/buyer1_mortgage_spec.rb | 4 -- .../sales/pages/buyer1_nationality_spec.rb | 4 -- .../pages/buyer1_previous_tenure_spec.rb | 4 -- .../pages/buyer1_working_situation_spec.rb | 4 -- .../buyer2_ethnic_background_arab_spec.rb | 4 -- .../buyer2_ethnic_background_asian_spec.rb | 4 -- .../buyer2_ethnic_background_black_spec.rb | 4 -- .../buyer2_ethnic_background_mixed_spec.rb | 4 -- .../buyer2_ethnic_background_white_spec.rb | 4 -- .../sales/pages/buyer2_ethnic_group_spec.rb | 4 -- .../buyer2_income_max_value_check_spec.rb | 4 -- .../buyer2_income_min_value_check_spec.rb | 4 -- .../form/sales/pages/buyer2_income_spec.rb | 4 -- .../pages/buyer2_live_in_property_spec.rb | 4 -- .../form/sales/pages/buyer2_living_in_spec.rb | 4 -- .../form/sales/pages/buyer2_mortgage_spec.rb | 4 -- .../sales/pages/buyer2_nationality_spec.rb | 4 -- .../buyer2_previous_housing_situation_spec.rb | 4 -- .../buyer2_relationship_to_buyer1_spec.rb | 4 -- .../pages/buyer2_working_situation_spec.rb | 4 -- .../pages/buyer_live_in_value_check_spec.rb | 4 -- .../form/sales/pages/buyer_previous_spec.rb | 4 -- .../sales/pages/buyer_still_serving_spec.rb | 4 -- .../sales/pages/buyers_organisations_spec.rb | 4 -- .../combined_income_max_value_check_spec.rb | 4 -- .../form/sales/pages/deposit_discount_spec.rb | 4 -- spec/models/form/sales/pages/deposit_spec.rb | 4 -- .../sales/pages/deposit_value_check_spec.rb | 4 -- spec/models/form/sales/pages/discount_spec.rb | 4 -- .../pages/discounted_ownership_type_spec.rb | 10 ---- .../pages/discounted_sale_value_check_spec.rb | 4 -- spec/models/form/sales/pages/equity_spec.rb | 4 -- .../form/sales/pages/exchange_date_spec.rb | 4 -- .../form/sales/pages/extra_borrowing_spec.rb | 4 -- .../form/sales/pages/gender_identity1_spec.rb | 4 -- .../form/sales/pages/gender_identity2_spec.rb | 4 -- spec/models/form/sales/pages/grant_spec.rb | 4 -- .../sales/pages/handover_date_check_spec.rb | 4 -- .../form/sales/pages/handover_date_spec.rb | 4 -- .../sales/pages/household_disability_spec.rb | 4 -- .../pages/household_wheelchair_check_spec.rb | 4 -- .../sales/pages/household_wheelchair_spec.rb | 4 -- .../form/sales/pages/housing_benefits_spec.rb | 4 -- .../form/sales/pages/la_nominations_spec.rb | 4 -- .../sales/pages/last_accommodation_la_spec.rb | 4 -- .../sales/pages/last_accommodation_spec.rb | 4 -- .../sales/pages/leasehold_charges_spec.rb | 4 -- .../pages/living_before_purchase_spec.rb | 4 -- .../pages/monthly_charges_value_check_spec.rb | 4 -- .../form/sales/pages/monthly_rent_spec.rb | 4 -- .../form/sales/pages/mortgage_amount_spec.rb | 4 -- .../sales/pages/mortgage_lender_other_spec.rb | 4 -- .../form/sales/pages/mortgage_lender_spec.rb | 4 -- .../form/sales/pages/mortgage_length_spec.rb | 4 -- .../sales/pages/mortgage_value_check_spec.rb | 4 -- .../multiple_partners_value_check_spec.rb | 4 -- .../form/sales/pages/no_address_found_spec.rb | 4 -- .../number_of_others_in_property_spec.rb | 4 -- ...rsons_shared_ownership_value_check_spec.rb | 4 -- .../pages/partner_under16_value_check_spec.rb | 4 -- .../percentage_discount_value_check_spec.rb | 4 -- .../form/sales/pages/person_age_spec.rb | 4 -- .../pages/person_gender_identity_spec.rb | 4 -- .../form/sales/pages/person_known_spec.rb | 4 -- .../person_relationship_to_buyer1_spec.rb | 4 -- ...rson_student_not_child_value_check_spec.rb | 4 -- .../pages/person_working_situation_spec.rb | 4 -- spec/models/form/sales/pages/postcode_spec.rb | 4 -- .../sales/pages/previous_bedrooms_spec.rb | 4 -- .../sales/pages/previous_ownership_spec.rb | 4 -- .../pages/previous_property_type_spec.rb | 4 -- .../form/sales/pages/previous_shared_spec.rb | 4 -- .../form/sales/pages/previous_tenure_spec.rb | 4 -- .../form/sales/pages/privacy_notice_spec.rb | 4 -- .../pages/property_building_type_spec.rb | 4 -- .../pages/property_local_authority_spec.rb | 4 -- .../pages/property_number_of_bedrooms_spec.rb | 4 -- .../sales/pages/property_unit_type_spec.rb | 4 -- .../property_wheelchair_accessible_spec.rb | 4 -- .../purchase_price_outright_ownership_spec.rb | 4 -- .../form/sales/pages/purchase_price_spec.rb | 4 -- spec/models/form/sales/pages/resale_spec.rb | 4 -- .../pages/retirement_value_check_spec.rb | 4 -- .../form/sales/pages/sale_date_check_spec.rb | 4 -- spec/models/form/sales/pages/savings_spec.rb | 4 -- .../sales/pages/savings_value_check_spec.rb | 4 -- ...ared_ownership_deposit_value_check_spec.rb | 4 -- .../pages/staircase_owned_value_check_spec.rb | 4 -- .../models/form/sales/pages/staircase_spec.rb | 4 -- .../sales/pages/uprn_confirmation_spec.rb | 4 -- .../form/sales/pages/uprn_selection_spec.rb | 4 -- spec/models/form/sales/pages/uprn_spec.rb | 4 -- .../pages/value_shared_ownership_spec.rb | 4 -- .../address_line1_for_address_matcher_spec.rb | 12 ----- .../sales/questions/address_line1_spec.rb | 12 ----- .../sales/questions/address_line2_spec.rb | 14 +---- spec/models/form/sales/questions/age1_spec.rb | 12 ----- spec/models/form/sales/questions/age2_spec.rb | 12 ----- .../form/sales/questions/armed_forces_spec.rb | 12 ----- .../questions/armed_forces_spouse_spec.rb | 12 ----- .../sales/questions/buyer1_age_known_spec.rb | 12 ----- .../buyer1_ethnic_background_arab_spec.rb | 12 ----- .../buyer1_ethnic_background_asian_spec.rb | 12 ----- .../buyer1_ethnic_background_black_spec.rb | 12 ----- .../buyer1_ethnic_background_mixed_spec.rb | 12 ----- .../buyer1_ethnic_background_white_spec.rb | 16 ------ .../questions/buyer1_ethnic_group_spec.rb | 12 ----- .../questions/buyer1_income_known_spec.rb | 8 --- .../sales/questions/buyer1_income_spec.rb | 12 ----- .../buyer1_income_value_check_spec.rb | 12 ----- .../questions/buyer1_live_in_property_spec.rb | 12 ----- .../sales/questions/buyer1_mortgage_spec.rb | 8 --- .../questions/buyer1_nationality_spec.rb | 12 ----- .../questions/buyer1_previous_tenure_spec.rb | 8 --- .../buyer1_working_situation_spec.rb | 8 --- .../sales/questions/buyer2_age_known_spec.rb | 8 --- .../buyer2_ethnic_background_arab_spec.rb | 12 ----- .../buyer2_ethnic_background_asian_spec.rb | 12 ----- .../buyer2_ethnic_background_black_spec.rb | 12 ----- .../buyer2_ethnic_background_mixed_spec.rb | 12 ----- .../buyer2_ethnic_background_white_spec.rb | 12 ----- .../questions/buyer2_ethnic_group_spec.rb | 12 ----- .../questions/buyer2_income_known_spec.rb | 8 --- .../sales/questions/buyer2_income_spec.rb | 12 ----- .../buyer2_income_value_check_spec.rb | 12 ----- .../questions/buyer2_live_in_property_spec.rb | 12 ----- .../sales/questions/buyer2_living_in_spec.rb | 12 ----- .../sales/questions/buyer2_mortgage_spec.rb | 8 --- .../questions/buyer2_nationality_spec.rb | 12 ----- .../buyer2_relationship_to_buyer1_spec.rb | 12 ----- .../buyer2_working_situation_spec.rb | 12 ----- .../sales/questions/buyer_company_spec.rb | 4 -- .../buyer_live_in_value_check_spec.rb | 12 ----- .../sales/questions/buyer_previous_spec.rb | 26 ---------- .../questions/buyer_still_serving_spec.rb | 12 ----- .../questions/buyers_organisations_spec.rb | 12 ----- .../combined_income_value_check_spec.rb | 12 ----- .../form/sales/questions/county_spec.rb | 12 ----- .../sales/questions/deposit_amount_spec.rb | 18 ------- .../sales/questions/deposit_discount_spec.rb | 12 ----- .../questions/deposit_value_check_spec.rb | 12 ----- .../form/sales/questions/discount_spec.rb | 14 ----- .../discounted_ownership_type_spec.rb | 8 --- .../discounted_sale_value_check_spec.rb | 12 ----- .../form/sales/questions/equity_spec.rb | 12 ----- .../sales/questions/exchange_date_spec.rb | 8 --- .../sales/questions/extra_borrowing_spec.rb | 12 ----- .../form/sales/questions/fromprop_spec.rb | 12 ----- .../sales/questions/gender_identity1_spec.rb | 28 ---------- .../sales/questions/gender_identity2_spec.rb | 28 ---------- .../models/form/sales/questions/grant_spec.rb | 12 ----- .../questions/handover_date_check_spec.rb | 12 ----- .../sales/questions/handover_date_spec.rb | 8 --- .../questions/has_leasehold_charges_spec.rb | 12 ----- .../questions/household_disability_spec.rb | 12 ----- .../household_wheelchair_check_spec.rb | 12 ----- .../questions/household_wheelchair_spec.rb | 12 ----- .../sales/questions/housing_benefits_spec.rb | 22 -------- .../sales/questions/la_nominations_spec.rb | 12 ----- .../sales/questions/leasehold_charges_spec.rb | 12 ----- .../questions/living_before_purchase_spec.rb | 12 ----- .../living_before_purchase_years_spec.rb | 24 --------- .../monthly_charges_value_check_spec.rb | 12 ----- .../form/sales/questions/monthly_rent_spec.rb | 12 ----- .../sales/questions/mortgage_amount_spec.rb | 12 ----- .../questions/mortgage_lender_other_spec.rb | 12 ----- .../sales/questions/mortgage_lender_spec.rb | 8 --- .../sales/questions/mortgage_length_spec.rb | 14 ----- .../questions/mortgage_value_check_spec.rb | 12 ----- .../multiple_partners_value_check_spec.rb | 12 ----- .../questions/nationality_all_group_spec.rb | 24 --------- .../sales/questions/nationality_all_spec.rb | 16 ------ .../sales/questions/no_address_found_spec.rb | 12 ----- .../number_of_others_in_property_spec.rb | 24 --------- ...rsons_shared_ownership_value_check_spec.rb | 12 ----- .../questions/other_ownership_type_spec.rb | 8 --- .../sales/questions/ownership_scheme_spec.rb | 8 --- .../partner_under16_value_check_spec.rb | 12 ----- .../percentage_discount_value_check_spec.rb | 12 ----- .../sales/questions/person_age_known_spec.rb | 36 ------------- .../form/sales/questions/person_age_spec.rb | 24 --------- .../questions/person_gender_identity_spec.rb | 52 ------------------- .../form/sales/questions/person_known_spec.rb | 36 ------------- .../person_relationship_to_buyer1_spec.rb | 32 ------------ ...rson_student_not_child_value_check_spec.rb | 12 ----- .../person_working_situation_spec.rb | 32 ------------ .../postcode_for_address_matcher_spec.rb | 12 ----- .../postcode_for_full_address_spec.rb | 12 ----- .../sales/questions/postcode_known_spec.rb | 12 ----- .../form/sales/questions/postcode_spec.rb | 12 ----- .../sales/questions/previous_bedrooms_spec.rb | 12 ----- .../sales/questions/previous_la_known_spec.rb | 12 ----- .../questions/previous_postcode_known_spec.rb | 12 ----- .../sales/questions/previous_postcode_spec.rb | 12 ----- .../questions/previous_tenure_buyer2_spec.rb | 12 ----- .../sales/questions/previous_tenure_spec.rb | 12 ----- .../form/sales/questions/prevloc_spec.rb | 8 --- .../form/sales/questions/prevown_spec.rb | 26 ---------- .../form/sales/questions/prevshared_spec.rb | 12 ----- .../questions/property_building_type_spec.rb | 12 ----- .../property_local_authority_spec.rb | 8 --- .../property_number_of_bedrooms_spec.rb | 12 ----- .../questions/property_unit_type_spec.rb | 8 --- .../property_wheelchair_accessible_spec.rb | 18 ------- .../sales/questions/purchase_price_spec.rb | 24 --------- .../sales/questions/purchaser_code_spec.rb | 12 ----- .../form/sales/questions/resale_spec.rb | 12 ----- .../questions/retirement_value_check_spec.rb | 12 ----- .../sales/questions/sale_date_check_spec.rb | 12 ----- .../form/sales/questions/sale_date_spec.rb | 8 --- .../form/sales/questions/savings_nk_spec.rb | 12 ----- .../form/sales/questions/savings_spec.rb | 12 ----- .../questions/savings_value_check_spec.rb | 12 ----- ...ared_ownership_deposit_value_check_spec.rb | 16 ------ .../sales/questions/staircase_bought_spec.rb | 12 ----- .../sales/questions/staircase_owned_spec.rb | 26 ---------- .../staircase_owned_value_check_spec.rb | 12 ----- .../sales/questions/staircase_sale_spec.rb | 12 ----- .../form/sales/questions/staircase_spec.rb | 12 ----- .../form/sales/questions/town_or_city_spec.rb | 12 ----- .../sales/questions/uprn_confirmation_spec.rb | 12 ----- .../form/sales/questions/uprn_known_spec.rb | 16 ------ .../sales/questions/uprn_selection_spec.rb | 12 ----- spec/models/form/sales/questions/uprn_spec.rb | 12 ----- .../models/form/sales/questions/value_spec.rb | 12 ----- 371 files changed, 2 insertions(+), 3629 deletions(-) delete mode 100644 spec/models/form/lettings/questions/startertenancy_spec.rb diff --git a/spec/models/form/lettings/pages/address_fallback_spec.rb b/spec/models/form/lettings/pages/address_fallback_spec.rb index d0b13ca5c..d3971d540 100644 --- a/spec/models/form/lettings/pages/address_fallback_spec.rb +++ b/spec/models/form/lettings/pages/address_fallback_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::AddressFallback, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q12 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/address_matcher_spec.rb b/spec/models/form/lettings/pages/address_matcher_spec.rb index 16f571754..9f1470c01 100644 --- a/spec/models/form/lettings/pages/address_matcher_spec.rb +++ b/spec/models/form/lettings/pages/address_matcher_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::AddressMatcher, type: :model do expect(page.id).to eq("address_matcher") end - it "has the correct header" do - expect(page.header).to eq("Find an address") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/address_spec.rb b/spec/models/form/lettings/pages/address_spec.rb index cb275e530..4b3f9713e 100644 --- a/spec/models/form/lettings/pages/address_spec.rb +++ b/spec/models/form/lettings/pages/address_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::Address, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q13 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb index e37d6efc4..0530cf445 100644 --- a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb @@ -10,10 +10,6 @@ RSpec.describe Form::Lettings::Pages::CareHomeChargesValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/created_by_spec.rb b/spec/models/form/lettings/pages/created_by_spec.rb index d78614c00..774b826ee 100644 --- a/spec/models/form/lettings/pages/created_by_spec.rb +++ b/spec/models/form/lettings/pages/created_by_spec.rb @@ -47,10 +47,6 @@ RSpec.describe Form::Lettings::Pages::CreatedBy, type: :model do expect(page.id).to eq("assigned_to") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb index d789a850a..0b3d770b3 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb index 3a9e37d47..f380a5cb9 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb index 9cf49add6..b095af406 100644 --- a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing, type: expect(page.id).to eq("first_time_property_let_as_social_housing") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb index 2e9b3a9c3..1f2986064 100644 --- a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb +++ b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite, type: :mo expect(page.id).to eq("lead_tenant_ethnic_background_white") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/location_spec.rb b/spec/models/form/lettings/pages/location_spec.rb index 6de0b59dd..d1fc9b978 100644 --- a/spec/models/form/lettings/pages/location_spec.rb +++ b/spec/models/form/lettings/pages/location_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::Location, type: :model do expect(page.id).to eq("location") end - it "has the correct header" do - expect(page.header).to eq("Location") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/managing_organisation_spec.rb b/spec/models/form/lettings/pages/managing_organisation_spec.rb index 1c4e3a8df..ca4d57642 100644 --- a/spec/models/form/lettings/pages/managing_organisation_spec.rb +++ b/spec/models/form/lettings/pages/managing_organisation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do expect(page.id).to eq("managing_organisation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb b/spec/models/form/lettings/pages/max_rent_value_check_spec.rb index c11f9f412..273272d8b 100644 --- a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb +++ b/spec/models/form/lettings/pages/max_rent_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::MaxRentValueCheck, type: :model do expect(page.id).to eq("max_rent_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "rent_in_soft_max_range?" => true }]) end diff --git a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb b/spec/models/form/lettings/pages/min_rent_value_check_spec.rb index 1b128dd80..950f2f43f 100644 --- a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb +++ b/spec/models/form/lettings/pages/min_rent_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb index 2df5e394b..551a3b070 100644 --- a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/needs_type_spec.rb b/spec/models/form/lettings/pages/needs_type_spec.rb index a9e9d0fcc..bae2db6f4 100644 --- a/spec/models/form/lettings/pages/needs_type_spec.rb +++ b/spec/models/form/lettings/pages/needs_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::NeedsType, type: :model do expect(page.id).to eq("needs_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/net_income_value_check_spec.rb b/spec/models/form/lettings/pages/net_income_value_check_spec.rb index e21476fa5..523e02c8b 100644 --- a/spec/models/form/lettings/pages/net_income_value_check_spec.rb +++ b/spec/models/form/lettings/pages/net_income_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::NetIncomeValueCheck, type: :model do expect(page.id).to eq("net_income_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "net_income_soft_validation_triggered?" => true }]) end diff --git a/spec/models/form/lettings/pages/no_address_found_spec.rb b/spec/models/form/lettings/pages/no_address_found_spec.rb index 3f5dd7695..ad8c04e04 100644 --- a/spec/models/form/lettings/pages/no_address_found_spec.rb +++ b/spec/models/form/lettings/pages/no_address_found_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::NoAddressFound, type: :model do expect(page.id).to eq("no_address_found") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "address_options_present?" => false, "is_supported_housing?" => false, diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb index d62fccc13..286ac6183 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb index dca600e0f..205f19ae1 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb index 9ad520451..a769f95cc 100644 --- a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/person_age_spec.rb b/spec/models/form/lettings/pages/person_age_spec.rb index 562d91cfa..c9a57c138 100644 --- a/spec/models/form/lettings/pages/person_age_spec.rb +++ b/spec/models/form/lettings/pages/person_age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_gender_identity_spec.rb b/spec/models/form/lettings/pages/person_gender_identity_spec.rb index b487c3cfd..9bd63037e 100644 --- a/spec/models/form/lettings/pages/person_gender_identity_spec.rb +++ b/spec/models/form/lettings/pages/person_gender_identity_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonGenderIdentity, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_known_spec.rb b/spec/models/form/lettings/pages/person_known_spec.rb index 7bc4bce83..6e6f22f75 100644 --- a/spec/models/form/lettings/pages/person_known_spec.rb +++ b/spec/models/form/lettings/pages/person_known_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonKnown, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to eq("You’ve given us the details for 1 person in the household") - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb index 4cebf77b7..ec00f0d75 100644 --- a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb index a73e94482..a0ebb9cbc 100644 --- a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb +++ b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonRelationshipToLead, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb index 13023e1d0..37ca94f9e 100644 --- a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_working_situation_spec.rb b/spec/models/form/lettings/pages/person_working_situation_spec.rb index 9631a20a9..71ef0a8f2 100644 --- a/spec/models/form/lettings/pages/person_working_situation_spec.rb +++ b/spec/models/form/lettings/pages/person_working_situation_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonWorkingSituation, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb b/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb index 017ff5978..af8e7b5fc 100644 --- a/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb +++ b/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::PreviousHousingSituationRenewal, type: :mo expect(page.id).to eq("previous_housing_situation_renewal") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/previous_housing_situation_spec.rb b/spec/models/form/lettings/pages/previous_housing_situation_spec.rb index 1baef7198..9c86a5827 100644 --- a/spec/models/form/lettings/pages/previous_housing_situation_spec.rb +++ b/spec/models/form/lettings/pages/previous_housing_situation_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::PreviousHousingSituation, type: :model do expect(page.id).to eq("previous_housing_situation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/previous_local_authority_spec.rb b/spec/models/form/lettings/pages/previous_local_authority_spec.rb index 7c5649b3f..9e6d91be3 100644 --- a/spec/models/form/lettings/pages/previous_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/previous_local_authority_spec.rb @@ -24,10 +24,6 @@ RSpec.describe Form::Lettings::Pages::PreviousLocalAuthority, type: :model do expect(page.id).to eq("previous_local_authority") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/previous_postcode_spec.rb b/spec/models/form/lettings/pages/previous_postcode_spec.rb index 83a3f44f3..eba9af065 100644 --- a/spec/models/form/lettings/pages/previous_postcode_spec.rb +++ b/spec/models/form/lettings/pages/previous_postcode_spec.rb @@ -24,10 +24,6 @@ RSpec.describe Form::Lettings::Pages::PreviousPostcode, type: :model do expect(page.id).to eq("previous_postcode") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_local_authority_spec.rb b/spec/models/form/lettings/pages/property_local_authority_spec.rb index b3f73e505..fe5363d97 100644 --- a/spec/models/form/lettings/pages/property_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/property_local_authority_spec.rb @@ -28,10 +28,6 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do expect(page.id).to eq("property_local_authority") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb b/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb index 67c6504b7..708485ff6 100644 --- a/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb +++ b/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::PropertyNumberOfTimesRelet, type: :model d expect(page.id).to eq("property_number_of_times_relet") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_reference_spec.rb b/spec/models/form/lettings/pages/property_reference_spec.rb index ee53c3aae..59bd4440e 100644 --- a/spec/models/form/lettings/pages/property_reference_spec.rb +++ b/spec/models/form/lettings/pages/property_reference_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::PropertyReference, type: :model do expect(page.id).to eq("property_reference") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb index 06144b2b4..90da08fb6 100644 --- a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb @@ -21,10 +21,6 @@ RSpec.describe Form::Lettings::Pages::PropertyWheelchairAccessible, type: :model expect(page.id).to eq("property_wheelchair_accessible") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/renewal_spec.rb b/spec/models/form/lettings/pages/renewal_spec.rb index aec06352d..edeeaff1b 100644 --- a/spec/models/form/lettings/pages/renewal_spec.rb +++ b/spec/models/form/lettings/pages/renewal_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::Renewal, type: :model do expect(page.id).to eq("renewal") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/rent_type_spec.rb b/spec/models/form/lettings/pages/rent_type_spec.rb index 0b3b6bf90..41dc0a1a9 100644 --- a/spec/models/form/lettings/pages/rent_type_spec.rb +++ b/spec/models/form/lettings/pages/rent_type_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::RentType, type: :model do expect(page.id).to eq("rent_type") end - it "has the correct header" do - expect(page.header).to eq("Rent Type") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/scheme_spec.rb b/spec/models/form/lettings/pages/scheme_spec.rb index 96d66da2b..6f0bb55de 100644 --- a/spec/models/form/lettings/pages/scheme_spec.rb +++ b/spec/models/form/lettings/pages/scheme_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::Scheme, type: :model do expect(page.id).to eq("scheme") end - it "has the correct header" do - expect(page.header).to eq("Scheme") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb b/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb index e2e1d1086..8df3c9a62 100644 --- a/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb +++ b/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::ShelteredAccommodation, type: :model do expect(page.id).to eq("sheltered_accommodation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb index 14388539c..6842f7d3e 100644 --- a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Lettings::Pages::StarterTenancyType, type: :model do expect(page.id).to eq("starter_tenancy_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/stock_owner_spec.rb b/spec/models/form/lettings/pages/stock_owner_spec.rb index bb0ddd3dc..557345dc8 100644 --- a/spec/models/form/lettings/pages/stock_owner_spec.rb +++ b/spec/models/form/lettings/pages/stock_owner_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::StockOwner, type: :model do expect(page.id).to eq("stock_owner") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb index d7463f694..88623c0bb 100644 --- a/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::TenancyLengthPeriodic, type: :model do expect(page.id).to eq "tenancy_length_periodic" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_length_spec.rb b/spec/models/form/lettings/pages/tenancy_length_spec.rb index aef5f3fd0..9b9657d21 100644 --- a/spec/models/form/lettings/pages/tenancy_length_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_length_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::TenancyLength, type: :model do expect(page.id).to eq "tenancy_length" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_start_date_spec.rb b/spec/models/form/lettings/pages/tenancy_start_date_spec.rb index 8157f1872..e183d9683 100644 --- a/spec/models/form/lettings/pages/tenancy_start_date_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_start_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::TenancyStartDate, type: :model do expect(page.id).to eq("tenancy_start_date") end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_type_spec.rb b/spec/models/form/lettings/pages/tenancy_type_spec.rb index e4b6a04e5..55bb119ff 100644 --- a/spec/models/form/lettings/pages/tenancy_type_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_type_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::TenancyType, type: :model do expect(page.id).to eq "tenancy_type" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenant_code_spec.rb b/spec/models/form/lettings/pages/tenant_code_spec.rb index 636fbce83..25b124fe1 100644 --- a/spec/models/form/lettings/pages/tenant_code_spec.rb +++ b/spec/models/form/lettings/pages/tenant_code_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::TenantCode, type: :model do expect(page.id).to eq("tenant_code") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/uprn_confirmation_spec.rb b/spec/models/form/lettings/pages/uprn_confirmation_spec.rb index 1f66964f4..91bb7b759 100644 --- a/spec/models/form/lettings/pages/uprn_confirmation_spec.rb +++ b/spec/models/form/lettings/pages/uprn_confirmation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::UprnConfirmation, type: :model do expect(page.id).to eq("uprn_confirmation") end - it "has the correct header" do - expect(page.header).to eq("We found an address that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/uprn_selection_spec.rb b/spec/models/form/lettings/pages/uprn_selection_spec.rb index a2e8086d0..00dcd9508 100644 --- a/spec/models/form/lettings/pages/uprn_selection_spec.rb +++ b/spec/models/form/lettings/pages/uprn_selection_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::UprnSelection, type: :model do expect(page.id).to eq("uprn_selection") end - it "has the correct header" do - expect(page.header).to eq("We found some addresses that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/uprn_spec.rb b/spec/models/form/lettings/pages/uprn_spec.rb index c41de5f6a..2ab83c76a 100644 --- a/spec/models/form/lettings/pages/uprn_spec.rb +++ b/spec/models/form/lettings/pages/uprn_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do expect(page.id).to eq("uprn") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/void_date_spec.rb b/spec/models/form/lettings/pages/void_date_spec.rb index 5e3cbd323..6fc5cf1c9 100644 --- a/spec/models/form/lettings/pages/void_date_spec.rb +++ b/spec/models/form/lettings/pages/void_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::VoidDate, type: :model do expect(page.id).to eq("void_date") end - it "has the correct header" do - expect(page.header).to eq("Void date") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb b/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb index 19995e950..b8323662c 100644 --- a/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb +++ b/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb @@ -16,18 +16,10 @@ RSpec.describe Form::Lettings::Questions::AddressLine1ForAddressMatcher, type: : expect(question.id).to eq("address_line1_input") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Find address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -40,10 +32,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine1ForAddressMatcher, type: : expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("Address line 1\nAA1 1AA") end diff --git a/spec/models/form/lettings/questions/address_line1_spec.rb b/spec/models/form/lettings/questions/address_line1_spec.rb index 7416ef97a..212e3be9b 100644 --- a/spec/models/form/lettings/questions/address_line1_spec.rb +++ b/spec/models/form/lettings/questions/address_line1_spec.rb @@ -15,18 +15,10 @@ RSpec.describe Form::Lettings::Questions::AddressLine1, type: :model do expect(question.id).to eq("address_line1") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Address lines 1 and 2") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine1, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/address_line2_spec.rb b/spec/models/form/lettings/questions/address_line2_spec.rb index 4948a77bf..430a6d18b 100644 --- a/spec/models/form/lettings/questions/address_line2_spec.rb +++ b/spec/models/form/lettings/questions/address_line2_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine2, type: :model do expect(question.id).to eq("address_line2") end - it "has the correct header" do - expect(question.header).to eq("Address line 2 (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/age1_known_spec.rb b/spec/models/form/lettings/questions/age1_known_spec.rb index 5665f27ac..6ec594359 100644 --- a/spec/models/form/lettings/questions/age1_known_spec.rb +++ b/spec/models/form/lettings/questions/age1_known_spec.rb @@ -33,18 +33,10 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - it "has the correct id" do expect(question.id).to eq("age1_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the lead tenant’s age?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age1" => [0], @@ -69,20 +61,4 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest.") - end - end end diff --git a/spec/models/form/lettings/questions/age_known_spec.rb b/spec/models/form/lettings/questions/age_known_spec.rb index 8e4c60fe6..5f7946a16 100644 --- a/spec/models/form/lettings/questions/age_known_spec.rb +++ b/spec/models/form/lettings/questions/age_known_spec.rb @@ -26,23 +26,11 @@ RSpec.describe Form::Lettings::Questions::AgeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - context "with person 2" do it "has the correct id" do expect(question.id).to eq("age2_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 2’s age?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age2" => [0], @@ -76,10 +64,6 @@ RSpec.describe Form::Lettings::Questions::AgeKnown, type: :model do expect(question.id).to eq("age3_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 3’s age?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age3" => [0], diff --git a/spec/models/form/lettings/questions/age_spec.rb b/spec/models/form/lettings/questions/age_spec.rb index 3fe34e51b..4ec1ee985 100644 --- a/spec/models/form/lettings/questions/age_spec.rb +++ b/spec/models/form/lettings/questions/age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.page).to eq(page) end - it "has the correct header" do - expect(question.header).to eq("Age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -24,20 +20,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.derived?(nil)).to be false end - context "when child" do - let(:person_type) { "child" } - - it "has the correct hint" do - expect(question.hint_text).to eq("For a child under 1, enter 1") - end - end - - context "when not child" do - it "has no hint" do - expect(question.hint_text).to be nil - end - end - it "has the correct min" do expect(question.min).to eq(1) end @@ -55,10 +37,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.id).to eq("age2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([ { @@ -80,10 +58,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.id).to eq("age3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([ { diff --git a/spec/models/form/lettings/questions/beds_spec.rb b/spec/models/form/lettings/questions/beds_spec.rb index e594a4140..0ae62d049 100644 --- a/spec/models/form/lettings/questions/beds_spec.rb +++ b/spec/models/form/lettings/questions/beds_spec.rb @@ -7,28 +7,6 @@ RSpec.describe Form::Lettings::Questions::Beds, type: :model do let(:subsection) { instance_double(Form::Subsection, form:) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } - describe "the hint text" do - context "when the start date is before 24/25" do - before do - allow(form).to receive(:start_year_after_2024?).and_return false - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom.") - end - end - - context "when the start date is 24/25 or after" do - before do - allow(form).to receive(:start_year_after_2024?).and_return true - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("If shared accommodation, enter the number of bedrooms occupied by this household.") - end - end - end - describe "whether the field is derived" do context "when the log is a bedsit" do let(:log) { build(:lettings_log, unittype_gn: 2) } diff --git a/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb index 5b14949a3..0e8977d7a 100644 --- a/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Lettings::Questions::CareHomeChargesValueCheck, type: :mode expect(question.id).to eq("carehome_charges_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure there are no care home charges?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Care home charges confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -30,10 +22,6 @@ RSpec.describe Form::Lettings::Questions::CareHomeChargesValueCheck, type: :mode expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/lettings/questions/county_spec.rb b/spec/models/form/lettings/questions/county_spec.rb index c3473e75d..05707112d 100644 --- a/spec/models/form/lettings/questions/county_spec.rb +++ b/spec/models/form/lettings/questions/county_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::County, type: :model do expect(question.id).to eq("county") end - it "has the correct header" do - expect(question.header).to eq("County (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("County") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::County, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/created_by_id_spec.rb b/spec/models/form/lettings/questions/created_by_id_spec.rb index 82c0aa65d..1cae12396 100644 --- a/spec/models/form/lettings/questions/created_by_id_spec.rb +++ b/spec/models/form/lettings/questions/created_by_id_spec.rb @@ -17,22 +17,10 @@ RSpec.describe Form::Lettings::Questions::CreatedById, type: :model do expect(question.id).to eq("assigned_to_id") end - it "has the correct header" do - expect(question.header).to eq("Which user are you creating this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Log owner") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer options" do expect(question.answer_options).to eq({ "" => "Select an option" }) end diff --git a/spec/models/form/lettings/questions/declaration_spec.rb b/spec/models/form/lettings/questions/declaration_spec.rb index ea1e10402..bf8743520 100644 --- a/spec/models/form/lettings/questions/declaration_spec.rb +++ b/spec/models/form/lettings/questions/declaration_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do expect(question.id).to eq("declaration") end - it "has the correct header" do - expect(question.header).to eq("Declaration") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Tenant has seen the privacy notice") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - context "when the form year is before 2024" do before do allow(form).to receive(:start_year_after_2024?).and_return(false) diff --git a/spec/models/form/lettings/questions/details_known_spec.rb b/spec/models/form/lettings/questions/details_known_spec.rb index abedc3f11..43f90385a 100644 --- a/spec/models/form/lettings/questions/details_known_spec.rb +++ b/spec/models/form/lettings/questions/details_known_spec.rb @@ -19,23 +19,11 @@ RSpec.describe Form::Lettings::Questions::DetailsKnown, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You must provide details for everyone in the household if you know them.") - end - context "with person 2" do it "has the correct id" do expect(question.id).to eq("details_known_2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 2") - end - - it "has the correct header" do - expect(question.header).to eq("Do you know details for person 2?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end @@ -48,14 +36,6 @@ RSpec.describe Form::Lettings::Questions::DetailsKnown, type: :model do expect(question.id).to eq("details_known_3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 3") - end - - it "has the correct header" do - expect(question.header).to eq("Do you know details for person 3?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end diff --git a/spec/models/form/lettings/questions/ethnic_white_spec.rb b/spec/models/form/lettings/questions/ethnic_white_spec.rb index cff675d64..7857893a1 100644 --- a/spec/models/form/lettings/questions/ethnic_white_spec.rb +++ b/spec/models/form/lettings/questions/ethnic_white_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the lead tenant’s White background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -48,10 +40,6 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end end context "with 2024/25 form" do @@ -68,10 +56,6 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end end it "has the correct check_answers_card_number" do diff --git a/spec/models/form/lettings/questions/gender_identity1_spec.rb b/spec/models/form/lettings/questions/gender_identity1_spec.rb index 67c7d54c8..2a943cbe0 100644 --- a/spec/models/form/lettings/questions/gender_identity1_spec.rb +++ b/spec/models/form/lettings/questions/gender_identity1_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do expect(question.id).to eq("sex1") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes the lead tenant’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s gender identity") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end @@ -46,24 +38,4 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do "R" => { "value" => "Tenant prefers not to say" }, }) end - - context "with form year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end - end - - context "with form year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end end diff --git a/spec/models/form/lettings/questions/hb_spec.rb b/spec/models/form/lettings/questions/hb_spec.rb index 20e775fcc..ed8f19cd5 100644 --- a/spec/models/form/lettings/questions/hb_spec.rb +++ b/spec/models/form/lettings/questions/hb_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do expect(question.id).to eq("hb") end - it "has the correct header" do - expect(question.header).to eq("Is the household likely to be receiving any of these housing-related benefits?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Housing-related benefits received") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -51,22 +43,6 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do }) end - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive.") - end - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/lettings/questions/homeless_spec.rb b/spec/models/form/lettings/questions/homeless_spec.rb index e9dfbcaef..40beb9698 100644 --- a/spec/models/form/lettings/questions/homeless_spec.rb +++ b/spec/models/form/lettings/questions/homeless_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Lettings::Questions::Homeless, type: :model do expect(question.id).to eq("homeless") end - it "has the correct header" do - expect(question.header).to eq("Did the household experience homelessness immediately before this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Household homeless immediately before letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/housingneeds_other_spec.rb b/spec/models/form/lettings/questions/housingneeds_other_spec.rb index 9e1e628ff..f7be373e1 100644 --- a/spec/models/form/lettings/questions/housingneeds_other_spec.rb +++ b/spec/models/form/lettings/questions/housingneeds_other_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do expect(question.id).to eq("housingneeds_other") end - it "has the correct header" do - expect(question.header).to eq("Do they have any other disabled access needs?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Other disabled access needs") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/irproduct_other_spec.rb b/spec/models/form/lettings/questions/irproduct_other_spec.rb index 2406e4618..ca3b3ff8e 100644 --- a/spec/models/form/lettings/questions/irproduct_other_spec.rb +++ b/spec/models/form/lettings/questions/irproduct_other_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::IrproductOther, type: :model do expect(question.id).to eq("irproduct_other") end - it "has the correct header" do - expect(question.header).to eq("Name of rent product") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Product name") - end - it "has the correct type" do expect(question.type).to eq("text") end diff --git a/spec/models/form/lettings/questions/is_carehome_spec.rb b/spec/models/form/lettings/questions/is_carehome_spec.rb index 77fb7804b..958873599 100644 --- a/spec/models/form/lettings/questions/is_carehome_spec.rb +++ b/spec/models/form/lettings/questions/is_carehome_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do expect(question.id).to eq("is_carehome") end - it "has the correct header" do - expect(question.header).to eq("Is this accommodation a care home?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Care home accommodation") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/joint_spec.rb b/spec/models/form/lettings/questions/joint_spec.rb index 7c5b26402..1207d97d4 100644 --- a/spec/models/form/lettings/questions/joint_spec.rb +++ b/spec/models/form/lettings/questions/joint_spec.rb @@ -23,22 +23,10 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do expect(question.id).to eq("joint") end - it "has the correct header" do - expect(question.header).to eq("Is this a joint tenancy?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this a joint tenancy?") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -51,14 +39,4 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is where two or more people are named on the tenancy agreement") - end - end end diff --git a/spec/models/form/lettings/questions/layear_spec.rb b/spec/models/form/lettings/questions/layear_spec.rb index 7d3ec681c..04296beae 100644 --- a/spec/models/form/lettings/questions/layear_spec.rb +++ b/spec/models/form/lettings/questions/layear_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do expect(question.id).to eq("layear") end - it "has the correct header" do - expect(question.header).to eq("How long has the household continuously lived in the local authority area of the new letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of time in local authority area") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/letting_allocation_spec.rb b/spec/models/form/lettings/questions/letting_allocation_spec.rb index ccd0f8a53..63c750e5d 100644 --- a/spec/models/form/lettings/questions/letting_allocation_spec.rb +++ b/spec/models/form/lettings/questions/letting_allocation_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do expect(question.id).to eq("letting_allocation") end - it "has the correct header" do - expect(question.header).to eq("How was this letting allocated?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Allocation system") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end diff --git a/spec/models/form/lettings/questions/location_id_spec.rb b/spec/models/form/lettings/questions/location_id_spec.rb index ac3cfb8b5..2b5572cb5 100644 --- a/spec/models/form/lettings/questions/location_id_spec.rb +++ b/spec/models/form/lettings/questions/location_id_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do expect(question.id).to eq("location_id") end - it "has the correct header" do - expect(question.header).to eq("Which location is this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Location") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -177,16 +169,6 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do end end - context "with collection year on or after 2023" do - before do - allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 4, 1)) - end - - it "has the correct header" do - expect(question.header).to eq("Which location is this letting for?") - end - end - describe "partial guidance" do it "shows shows correct top_guidance_partial" do expect(question.top_guidance_partial).to eq("finding_location") diff --git a/spec/models/form/lettings/questions/managing_organisation_spec.rb b/spec/models/form/lettings/questions/managing_organisation_spec.rb index 99319fc71..776a873a6 100644 --- a/spec/models/form/lettings/questions/managing_organisation_spec.rb +++ b/spec/models/form/lettings/questions/managing_organisation_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do expect(question.id).to eq("managing_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation manages this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Managing agent") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "#displayed_answer_options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb index 0fea335c4..6fa0784e4 100644 --- a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb +++ b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do expect(question.id).to eq("rent_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Total rent confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end - it "has the correct hint" do - expect(question.hint_text).to eq("Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the rent type is correct, for example affordable or social rent
") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb index fec1e7d97..c3d8a16bc 100644 --- a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb +++ b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::MinRentValueCheck, type: :model do expect(question.id).to eq("rent_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Total rent confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end - it "has the correct hint" do - expect(question.hint_text).to eq("Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the rent type is correct, for example affordable or social rent
") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb index d946468b0..bc8d2d3a6 100644 --- a/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::MultiplePartnersValueCheck, type: :mod expect(question.id).to eq("multiple_partners_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Multiple partners confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::MultiplePartnersValueCheck, type: :mod expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/lettings/questions/nationality_all_group_spec.rb b/spec/models/form/lettings/questions/nationality_all_group_spec.rb index 5be7f13a5..8ef93a98a 100644 --- a/spec/models/form/lettings/questions/nationality_all_group_spec.rb +++ b/spec/models/form/lettings/questions/nationality_all_group_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::NationalityAllGroup, type: :model do expect(question.id).to eq("nationality_all_group") end - it "has the correct header" do - expect(question.header).to eq("What is the nationality of the lead tenant?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s nationality") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "826" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/lettings/questions/nationality_all_spec.rb b/spec/models/form/lettings/questions/nationality_all_spec.rb index 9c274e06c..a4d187a16 100644 --- a/spec/models/form/lettings/questions/nationality_all_spec.rb +++ b/spec/models/form/lettings/questions/nationality_all_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::NationalityAll, type: :model do expect(question.id).to eq("nationality_all") end - it "has the correct header" do - expect(question.header).to eq("Enter a nationality") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s nationality") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options.count).to eq(203) end diff --git a/spec/models/form/lettings/questions/nationality_spec.rb b/spec/models/form/lettings/questions/nationality_spec.rb index 600ef2692..5bdebc57e 100644 --- a/spec/models/form/lettings/questions/nationality_spec.rb +++ b/spec/models/form/lettings/questions/nationality_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::Nationality, type: :model do expect(question.id).to eq("national") end - it "has the correct header" do - expect(question.header).to eq("What is the nationality of the lead tenant?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s nationality") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "18" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/lettings/questions/needs_type_spec.rb b/spec/models/form/lettings/questions/needs_type_spec.rb index eafc9bba6..c63800413 100644 --- a/spec/models/form/lettings/questions/needs_type_spec.rb +++ b/spec/models/form/lettings/questions/needs_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::NeedsType, type: :model do expect(question.id).to eq("needstype") end - it "has the correct header" do - expect(question.header).to eq("What is the needs type?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Needs type") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/no_address_found_spec.rb b/spec/models/form/lettings/questions/no_address_found_spec.rb index 221ab6688..472642288 100644 --- a/spec/models/form/lettings/questions/no_address_found_spec.rb +++ b/spec/models/form/lettings/questions/no_address_found_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Lettings::Questions::NoAddressFound, type: :model do expect(question.id).to eq("address_search_value_check") end - it "has the correct header" do - expect(question.header).to eq("No address found") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -30,10 +22,6 @@ RSpec.describe Form::Lettings::Questions::NoAddressFound, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to be_nil end diff --git a/spec/models/form/lettings/questions/offered_spec.rb b/spec/models/form/lettings/questions/offered_spec.rb index 753ab459e..235be5210 100644 --- a/spec/models/form/lettings/questions/offered_spec.rb +++ b/spec/models/form/lettings/questions/offered_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Lettings::Questions::Offered, type: :model do expect(question.id).to eq "offered" end - it "has the correct header" do - expect(question.header).to eq "How many times was the property offered between becoming vacant and this letting?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Times previously offered since becoming available." - end - it "has the correct type" do expect(question.type).to eq "numeric" end @@ -37,8 +29,4 @@ RSpec.describe Form::Lettings::Questions::Offered, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - it "has the correct hint_text" do - expect(question.hint_text).to eq "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0." - end end diff --git a/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb b/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb index dfff2a22c..76c8f413d 100644 --- a/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::PartnerUnder16ValueCheck, type: :model expect(question.id).to eq("partner_under_16_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Partner under 16 confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::PartnerUnder16ValueCheck, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/lettings/questions/period_spec.rb b/spec/models/form/lettings/questions/period_spec.rb index 88b11deef..6adbac94f 100644 --- a/spec/models/form/lettings/questions/period_spec.rb +++ b/spec/models/form/lettings/questions/period_spec.rb @@ -5,10 +5,6 @@ RSpec.describe Form::Lettings::Questions::Period, type: :model do let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } - it "has the correct hint" do - expect(question.hint_text).to eq("Select how often the household is charged. This may be different to how often they pay.") - end - it "has correct answer options" do expect(question.answer_options).to eq( { diff --git a/spec/models/form/lettings/questions/person_gender_identity_spec.rb b/spec/models/form/lettings/questions/person_gender_identity_spec.rb index 60a0608e5..f9730739c 100644 --- a/spec/models/form/lettings/questions/person_gender_identity_spec.rb +++ b/spec/models/form/lettings/questions/person_gender_identity_spec.rb @@ -26,39 +26,11 @@ RSpec.describe Form::Lettings::Questions::PersonGenderIdentity, type: :model do expect(question.derived?(nil)).to be false end - context "with form year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - end - - context "with form year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end - context "with person 2" do it "has the correct id" do expect(question.id).to eq("sex2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s gender identity") - end - - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 2’s gender identity?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end @@ -71,14 +43,6 @@ RSpec.describe Form::Lettings::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s gender identity") - end - - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 3’s gender identity?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end diff --git a/spec/models/form/lettings/questions/person_relationship_spec.rb b/spec/models/form/lettings/questions/person_relationship_spec.rb index 65e9746d9..20d05e316 100644 --- a/spec/models/form/lettings/questions/person_relationship_spec.rb +++ b/spec/models/form/lettings/questions/person_relationship_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do "divider" => { "value" => true }) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has correct conditional for" do expect(question.conditional_for).to be nil end @@ -44,17 +40,9 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do expect(question.id).to eq("relat2") end - it "has the correct header" do - expect(question.header).to eq("What is person 2’s relationship to the lead tenant?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s relationship to the lead tenant") - end end context "with person 3" do @@ -64,16 +52,8 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do expect(question.id).to eq("relat3") end - it "has the correct header" do - expect(question.header).to eq("What is person 3’s relationship to the lead tenant?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s relationship to the lead tenant") - end end end diff --git a/spec/models/form/lettings/questions/person_working_situation_spec.rb b/spec/models/form/lettings/questions/person_working_situation_spec.rb index 03cd60019..4dd6a0065 100644 --- a/spec/models/form/lettings/questions/person_working_situation_spec.rb +++ b/spec/models/form/lettings/questions/person_working_situation_spec.rb @@ -41,10 +41,6 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d "divider" => { "value" => true }) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has correct conditional for" do expect(question.conditional_for).to be nil end @@ -58,17 +54,9 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d expect(question.id).to eq("ecstat2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 2’s working situation?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s working situation") - end end context "with person 3" do @@ -78,16 +66,8 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d expect(question.id).to eq("ecstat3") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 3’s working situation?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s working situation") - end end end diff --git a/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb b/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb index e59541efd..1a8e8d0d4 100644 --- a/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb +++ b/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForAddressMatcher, type: :mode expect(question.id).to eq("postcode_full_input") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq(nil) - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -36,10 +28,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForAddressMatcher, type: :mode expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("AA1 1AA") end diff --git a/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb b/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb index 0ccc8c26b..587f2648a 100644 --- a/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb +++ b/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForFullAddress, type: :model d expect(question.id).to eq("postcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Postcode") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForFullAddress, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/lettings/questions/ppcodenk_spec.rb b/spec/models/form/lettings/questions/ppcodenk_spec.rb index cc109c75f..8a29b032d 100644 --- a/spec/models/form/lettings/questions/ppcodenk_spec.rb +++ b/spec/models/form/lettings/questions/ppcodenk_spec.rb @@ -33,18 +33,10 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - it "has the correct id" do expect(question.id).to eq("ppcodenk") end - it "has the correct header" do - expect(question.header).to eq("Do you know the postcode of the household’s last settled accommodation?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "ppostcode_full" => [0], @@ -62,20 +54,4 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s ‘last settled home’.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.") - end - end end diff --git a/spec/models/form/lettings/questions/previous_la_known_spec.rb b/spec/models/form/lettings/questions/previous_la_known_spec.rb index fea17d56a..defb56bdf 100644 --- a/spec/models/form/lettings/questions/previous_la_known_spec.rb +++ b/spec/models/form/lettings/questions/previous_la_known_spec.rb @@ -33,18 +33,10 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Do you know the local authority of the household’s last settled accommodation?") - end - it "has the correct id" do expect(question.id).to eq("previous_la_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the local authority of the household’s last settled accommodation?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "prevloc" => [1], @@ -62,20 +54,4 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s ‘last settled home’.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.") - end - end end diff --git a/spec/models/form/lettings/questions/previous_let_type_spec.rb b/spec/models/form/lettings/questions/previous_let_type_spec.rb index bf9cf78f9..0739fe386 100644 --- a/spec/models/form/lettings/questions/previous_let_type_spec.rb +++ b/spec/models/form/lettings/questions/previous_let_type_spec.rb @@ -21,22 +21,10 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do expect(question.id).to eq "unitletas" end - it "has the correct header" do - expect(question.header).to eq "What type was the property most recently let as?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Most recent let type" - end - it "has the correct type" do expect(question.type).to eq "radio" end - it "has the correct hint_text" do - expect(question.hint_text).to eq "" - end - it "is not marked as derived" do expect(question.derived?(nil)).to be false end @@ -71,9 +59,5 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do "3" => { "value" => "Don’t know" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is the rent type of the previous tenancy in this property.") - end end end diff --git a/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb b/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb index 724b6f143..d672c573b 100644 --- a/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb +++ b/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb @@ -9,18 +9,10 @@ RSpec.describe Form::Lettings::Questions::PreviousTenureRenewal, type: :model do expect(question.id).to eq("prevten") end - it "has the correct header" do - expect(question.header).to eq("Where was the household immediately before this letting?") - end - it "has correct page" do expect(question.page).to eq(page) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Where was the household immediately before this letting?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -29,11 +21,6 @@ RSpec.describe Form::Lettings::Questions::PreviousTenureRenewal, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us this letting is a renewal. We have removed some options because of this.

- This is where the household was the night before they moved into this new let.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "34" => { "value" => "Specialist retirement housing" }, diff --git a/spec/models/form/lettings/questions/previous_tenure_spec.rb b/spec/models/form/lettings/questions/previous_tenure_spec.rb index 83c4d12de..2b8dcc338 100644 --- a/spec/models/form/lettings/questions/previous_tenure_spec.rb +++ b/spec/models/form/lettings/questions/previous_tenure_spec.rb @@ -9,18 +9,10 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do expect(question.id).to eq("prevten") end - it "has the correct header" do - expect(question.header).to eq("Where was the household immediately before this letting?") - end - it "has correct page" do expect(question.page).to eq(page) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Where was the household immediately before this letting?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -29,10 +21,6 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("This is where the household was the night before they moved into this new let.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "30" => { "value" => "Fixed-term local authority general needs tenancy" }, diff --git a/spec/models/form/lettings/questions/property_reference_spec.rb b/spec/models/form/lettings/questions/property_reference_spec.rb index 970bead96..0cbabcd66 100644 --- a/spec/models/form/lettings/questions/property_reference_spec.rb +++ b/spec/models/form/lettings/questions/property_reference_spec.rb @@ -16,22 +16,10 @@ RSpec.describe Form::Lettings::Questions::PropertyReference, type: :model do expect(question.id).to eq("propcode") end - it "has the correct header" do - expect(question.header).to eq("What is the property reference?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property reference") - end - it "has the correct type" do expect(question.type).to eq("text") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is how you usually refer to this property on your own systems.") - end - it "has the correct width" do expect(question.width).to eq(10) end diff --git a/spec/models/form/lettings/questions/reason_renewal_spec.rb b/spec/models/form/lettings/questions/reason_renewal_spec.rb index 6d507d1f6..02abe1527 100644 --- a/spec/models/form/lettings/questions/reason_renewal_spec.rb +++ b/spec/models/form/lettings/questions/reason_renewal_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do expect(question.id).to eq("reason") end - it "has the correct header" do - expect(question.header).to eq("What is the tenant’s main reason for the household leaving their last settled home?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Reason for leaving last settled home") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us this letting is a renewal. We have removed some options because of this.") - end - it "has the correct conditional_for" do expect(question.conditional_for).to eq({ "reasonother" => [20] }) end diff --git a/spec/models/form/lettings/questions/reason_spec.rb b/spec/models/form/lettings/questions/reason_spec.rb index ab7d4202d..81fd7a5c1 100644 --- a/spec/models/form/lettings/questions/reason_spec.rb +++ b/spec/models/form/lettings/questions/reason_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do expect(question.id).to eq("reason") end - it "has the correct header" do - expect(question.header).to eq("What is the tenant’s main reason for the household leaving their last settled home?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Reason for leaving last settled home") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -48,10 +40,6 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do end context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "40" => { "value" => "End of assured shorthold tenancy (no fault)" }, @@ -99,10 +87,6 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(true) end - it "has the correct hint" do - expect(question.hint_text).to eq("The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "50" => { "value" => "End of social or private sector tenancy - no fault" }, diff --git a/spec/models/form/lettings/questions/reasonpref_spec.rb b/spec/models/form/lettings/questions/reasonpref_spec.rb index ac39d8ba0..5957d4979 100644 --- a/spec/models/form/lettings/questions/reasonpref_spec.rb +++ b/spec/models/form/lettings/questions/reasonpref_spec.rb @@ -35,18 +35,10 @@ RSpec.describe Form::Lettings::Questions::Reasonpref, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Household given reasonable preference") - end - it "has the correct id" do expect(question.id).to eq("reasonpref") end - it "has the correct header" do - expect(question.header).to eq("Was the household given ‘reasonable preference’ by the local authority?") - end - it "has correct conditional for" do expect(question.conditional_for).to be_nil end @@ -58,20 +50,4 @@ RSpec.describe Form::Lettings::Questions::Reasonpref, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’.") - end - end end diff --git a/spec/models/form/lettings/questions/referral_prp_spec.rb b/spec/models/form/lettings/questions/referral_prp_spec.rb index f0fdb47e7..e11bf250c 100644 --- a/spec/models/form/lettings/questions/referral_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_prp_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us that the needs type is general needs. We have removed some options because of this.") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/referral_spec.rb b/spec/models/form/lettings/questions/referral_spec.rb index 5c7bc1735..b3f526697 100644 --- a/spec/models/form/lettings/questions/referral_spec.rb +++ b/spec/models/form/lettings/questions/referral_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this.") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb index de209092c..ab13acd26 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb index 0a09415a6..5e05bf65b 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us that you are a local authority. We have removed some options because of this.") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/renewal_spec.rb b/spec/models/form/lettings/questions/renewal_spec.rb index 1b921070c..27fe1bf86 100644 --- a/spec/models/form/lettings/questions/renewal_spec.rb +++ b/spec/models/form/lettings/questions/renewal_spec.rb @@ -23,22 +23,10 @@ RSpec.describe Form::Lettings::Questions::Renewal, type: :model do expect(question.id).to eq("renewal") end - it "has the correct header" do - expect(question.header).to eq("Is this letting a renewal?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property renewal") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -49,18 +37,4 @@ RSpec.describe Form::Lettings::Questions::Renewal, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct header" do - expect(question.header).to eq("Is this letting a renewal of social housing to the same tenant in the same property?") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("If the property was previously being used as temporary accommodation, then answer 'no'") - end - end end diff --git a/spec/models/form/lettings/questions/rent_type_spec.rb b/spec/models/form/lettings/questions/rent_type_spec.rb index f23ea45b4..15183ce6b 100644 --- a/spec/models/form/lettings/questions/rent_type_spec.rb +++ b/spec/models/form/lettings/questions/rent_type_spec.rb @@ -23,22 +23,10 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do expect(question.id).to eq("rent_type") end - it "has the correct header" do - expect(question.header).to eq("What is the rent type?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Rent type") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct conditional_for" do expect(question.conditional_for).to eq({ "irproduct_other" => [5] }) end diff --git a/spec/models/form/lettings/questions/rsnvac_spec.rb b/spec/models/form/lettings/questions/rsnvac_spec.rb index 8f796d548..45469cebb 100644 --- a/spec/models/form/lettings/questions/rsnvac_spec.rb +++ b/spec/models/form/lettings/questions/rsnvac_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do expect(question.id).to eq("rsnvac") end - it "has the correct header" do - expect(question.header).to eq("What is the reason for the property being vacant?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Vacancy reason") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/scheme_id_spec.rb b/spec/models/form/lettings/questions/scheme_id_spec.rb index 81bb23ca1..c490cded4 100644 --- a/spec/models/form/lettings/questions/scheme_id_spec.rb +++ b/spec/models/form/lettings/questions/scheme_id_spec.rb @@ -23,39 +23,10 @@ RSpec.describe Form::Lettings::Questions::SchemeId, type: :model do expect(question.id).to eq("scheme_id") end - it "has the correct header" do - expect(question.header).to eq("What scheme is this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Scheme name") - end - it "has the correct type" do expect(question.type).to eq("select") end - context "when 2023" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Enter postcode or scheme name") - end - end - - context "when 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Enter postcode or scheme name.

- A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people.") - end - end - it "has the correct conditional_for" do expect(question.conditional_for).to be_nil end diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 15668648f..33b1007d2 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -21,22 +21,10 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do expect(question.id).to eq "sheltered" end - it "has the correct header" do - expect(question.header).to eq "Is this letting in sheltered accommodation?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Is this letting in sheltered accommodation?" - end - it "has the correct type" do expect(question.type).to eq "radio" end - it "has the correct hint_text" do - expect(question.hint_text).to eq "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." - end - context "with 2023/24 form" do it "has the correct answer_options" do expect(question.answer_options).to eq({ diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index 81d0b8b3b..66ea2b355 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -19,18 +19,6 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(false) end - it "has the correct check answer label" do - expect(question.check_answer_label).to eq("Type of main tenancy after the starter period has ended") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is also known as an ‘introductory period’.") - end - - it "has the correct header" do - expect(question.header).to eq("What is the type of tenancy after the starter period has ended?") - end - it "has the correct answer options" do expect(question.answer_options).to eq( { @@ -65,18 +53,6 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(true) end - it "has the correct check answer label" do - expect(question.check_answer_label).to eq("Type of main tenancy after the starter or introductory period has ended") - end - - it "has the correct updated hint_text" do - expect(question.hint_text).to eq("") - end - - it "has the correct header" do - expect(question.header).to eq("What is the type of tenancy after the starter or introductory period has ended?") - end - it "has the correct answer options" do expect(question.answer_options).to eq( { diff --git a/spec/models/form/lettings/questions/startertenancy_spec.rb b/spec/models/form/lettings/questions/startertenancy_spec.rb deleted file mode 100644 index f5b1e7ec5..000000000 --- a/spec/models/form/lettings/questions/startertenancy_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Questions::Startertenancy, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } - - let(:question_id) { nil } - let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } - let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } - - before do - allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(form) - end - - context "with collection year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is also known as an ‘introductory period’.") - end - end - - context "with collection year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct updated hint_text" do - expect(question.hint_text).to eq("If the tenancy has an ‘introductory period’ answer ‘yes’.

- You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy.") - end - end -end diff --git a/spec/models/form/lettings/questions/stock_owner_spec.rb b/spec/models/form/lettings/questions/stock_owner_spec.rb index 9f668b8e1..2ed817833 100644 --- a/spec/models/form/lettings/questions/stock_owner_spec.rb +++ b/spec/models/form/lettings/questions/stock_owner_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do expect(question.id).to eq("owning_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation owns this property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Stock owner") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "answer options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index 45d2a80eb..fb334f909 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -23,29 +23,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the fixed-term tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of fixed-term tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies.") - end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years.") - end - end end diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index 9599997fb..0c0923bf8 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -23,29 +23,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the fixed-term tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of fixed-term tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies.") - end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year.") - end - end end diff --git a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb index 4a2563e6f..3a0fae171 100644 --- a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb @@ -15,19 +15,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the periodic tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of periodic tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue") - end end diff --git a/spec/models/form/lettings/questions/tenancy_length_spec.rb b/spec/models/form/lettings/questions/tenancy_length_spec.rb index 4d1e9ec50..2d87d0923 100644 --- a/spec/models/form/lettings/questions/tenancy_length_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the fixed-term tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of fixed-term tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.") - end - it "has the correct minimum and maximum" do expect(question.min).to eq 0 expect(question.max).to eq 150 diff --git a/spec/models/form/lettings/questions/tenancy_other_spec.rb b/spec/models/form/lettings/questions/tenancy_other_spec.rb index 554948ff3..ce8aec5db 100644 --- a/spec/models/form/lettings/questions/tenancy_other_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_other_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do expect(question.id).to eq("tenancyother") end - it "has the correct header" do - expect(question.header).to eq("Please state the tenancy type") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - it "has the correct type" do expect(question.type).to eq("text") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "is not marked as derived" do expect(question.derived?(nil)).to be false end diff --git a/spec/models/form/lettings/questions/tenancy_start_date_spec.rb b/spec/models/form/lettings/questions/tenancy_start_date_spec.rb index 35083ad01..67a0464b4 100644 --- a/spec/models/form/lettings/questions/tenancy_start_date_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_start_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::TenancyStartDate, type: :model do expect(question.id).to eq("startdate") end - it "has the correct header" do - expect(question.header).to eq("What is the tenancy start date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Tenancy start date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 196ec38bb..13998094a 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -21,22 +21,10 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do expect(question.id).to eq("tenancy") end - it "has the correct header" do - expect(question.header).to eq("What is the type of tenancy?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of main tenancy") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "has the correct conditional_for" do expect(question.conditional_for).to eq({ "tenancyother" => [3] }) end diff --git a/spec/models/form/lettings/questions/tenant_code_spec.rb b/spec/models/form/lettings/questions/tenant_code_spec.rb index e5e434427..833ebf0ee 100644 --- a/spec/models/form/lettings/questions/tenant_code_spec.rb +++ b/spec/models/form/lettings/questions/tenant_code_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::TenantCode, type: :model do expect(question.id).to eq("tenancycode") end - it "has the correct header" do - expect(question.header).to eq("What is the tenant code?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Tenant code") - end - it "has the correct type" do expect(question.type).to eq("text") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is how you usually refer to this tenancy on your own systems.") - end - it "has the correct width" do expect(question.width).to eq(10) end diff --git a/spec/models/form/lettings/questions/town_or_city_spec.rb b/spec/models/form/lettings/questions/town_or_city_spec.rb index 77867630f..5dab9d637 100644 --- a/spec/models/form/lettings/questions/town_or_city_spec.rb +++ b/spec/models/form/lettings/questions/town_or_city_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::TownOrCity, type: :model do expect(question.id).to eq("town_or_city") end - it "has the correct header" do - expect(question.header).to eq("Town or city") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Town or city") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::TownOrCity, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/uprn_confirmation_spec.rb b/spec/models/form/lettings/questions/uprn_confirmation_spec.rb index c0b6ef8a4..748f8979d 100644 --- a/spec/models/form/lettings/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/lettings/questions/uprn_confirmation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::UprnConfirmation, type: :model do expect(question.id).to eq("uprn_confirmed") end - it "has the correct header" do - expect(question.header).to eq("Is this the property address?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this the right address?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::UprnConfirmation, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must answer is this the right address?") end diff --git a/spec/models/form/lettings/questions/uprn_known_spec.rb b/spec/models/form/lettings/questions/uprn_known_spec.rb index 5f646e710..97a004f38 100644 --- a/spec/models/form/lettings/questions/uprn_known_spec.rb +++ b/spec/models/form/lettings/questions/uprn_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::UprnKnown, type: :model do expect(question.id).to eq("uprn_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -46,14 +38,6 @@ RSpec.describe Form::Lettings::Questions::UprnKnown, type: :model do expect(question.unanswered_error_message).to eq("You must answer UPRN known?") end - it "has the correct hint" do - expect(question.hint_text).to eq( - "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen.", - ) - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/lettings/questions/uprn_selection_spec.rb b/spec/models/form/lettings/questions/uprn_selection_spec.rb index 174aa017d..c3edc646e 100644 --- a/spec/models/form/lettings/questions/uprn_selection_spec.rb +++ b/spec/models/form/lettings/questions/uprn_selection_spec.rb @@ -32,14 +32,6 @@ RSpec.describe Form::Lettings::Questions::UprnSelection, type: :model do expect(question.id).to eq("uprn_selection") end - it "has the correct header" do - expect(question.header).to eq("Select the correct address") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Select the correct address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -52,10 +44,6 @@ RSpec.describe Form::Lettings::Questions::UprnSelection, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer options" do stub_request(:get, /api\.os\.uk/) .to_return(status: 200, body: "", headers: {}) diff --git a/spec/models/form/lettings/questions/uprn_spec.rb b/spec/models/form/lettings/questions/uprn_spec.rb index 7d4822c16..21f3e078b 100644 --- a/spec/models/form/lettings/questions/uprn_spec.rb +++ b/spec/models/form/lettings/questions/uprn_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::Uprn, type: :model do expect(question.id).to eq("uprn") end - it "has the correct header" do - expect(question.header).to eq("What is the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::Uprn, type: :model do expect(question.question_number).to eq(11) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("UPRN must be 12 digits or less.") end diff --git a/spec/models/form/lettings/questions/voiddate_spec.rb b/spec/models/form/lettings/questions/voiddate_spec.rb index 75e33abbd..639501c42 100644 --- a/spec/models/form/lettings/questions/voiddate_spec.rb +++ b/spec/models/form/lettings/questions/voiddate_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::Voiddate, type: :model do expect(question.id).to eq("voiddate") end - it "has the correct header" do - expect(question.header).to eq("What is the void date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Void date") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/lettings/questions/waityear_spec.rb b/spec/models/form/lettings/questions/waityear_spec.rb index 5b30cd641..5f1f344b9 100644 --- a/spec/models/form/lettings/questions/waityear_spec.rb +++ b/spec/models/form/lettings/questions/waityear_spec.rb @@ -26,18 +26,10 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of time on local authority waiting list") - end - it "has the correct id" do expect(question.id).to eq("waityear") end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has correct conditional for" do expect(question.conditional_for).to be_nil end @@ -51,10 +43,6 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do end context "with 2023/24 form" do - it "has the correct header" do - expect(question.header).to eq("How long has the household been on the local authority waiting list for the new letting?") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Less than 1 year" }, @@ -74,10 +62,6 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(true) end - it "has the correct header" do - expect(question.header).to eq("How long has the household been on the local authority waiting list for the area of the new letting?") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Less than 1 year" }, diff --git a/spec/models/form/lettings/questions/wheelchair_spec.rb b/spec/models/form/lettings/questions/wheelchair_spec.rb index d24320788..984a2209f 100644 --- a/spec/models/form/lettings/questions/wheelchair_spec.rb +++ b/spec/models/form/lettings/questions/wheelchair_spec.rb @@ -19,22 +19,10 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do expect(question.id).to eq("wchair") end - it "has the correct header" do - expect(question.header).to eq("Is the property built or adapted to wheelchair-user standards?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property built or adapted to wheelchair-user standards") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq "" - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -45,14 +33,4 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - context "with 2024 form" do - before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." - end - end end diff --git a/spec/models/form/sales/pages/about_price_value_check_spec.rb b/spec/models/form/sales/pages/about_price_value_check_spec.rb index 7b7099681..7d3c31537 100644 --- a/spec/models/form/sales/pages/about_price_value_check_spec.rb +++ b/spec/models/form/sales/pages/about_price_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do expect(page.id).to eq("savings_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "purchase_price_out_of_soft_range?" => true }]) end diff --git a/spec/models/form/sales/pages/about_staircase_spec.rb b/spec/models/form/sales/pages/about_staircase_spec.rb index 48aa82acf..181c3f695 100644 --- a/spec/models/form/sales/pages/about_staircase_spec.rb +++ b/spec/models/form/sales/pages/about_staircase_spec.rb @@ -36,10 +36,6 @@ RSpec.describe Form::Sales::Pages::AboutStaircase, type: :model do expect(page.id).to eq("an_id") end - it "has the correct header" do - expect(page.header).to eq("About the staircasing transaction") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/address_fallback_spec.rb b/spec/models/form/sales/pages/address_fallback_spec.rb index 395ac1a1b..4c48a46fe 100644 --- a/spec/models/form/sales/pages/address_fallback_spec.rb +++ b/spec/models/form/sales/pages/address_fallback_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::AddressFallback, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q12 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/address_matcher_spec.rb b/spec/models/form/sales/pages/address_matcher_spec.rb index 6d6a4174f..a0f1e1413 100644 --- a/spec/models/form/sales/pages/address_matcher_spec.rb +++ b/spec/models/form/sales/pages/address_matcher_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::AddressMatcher, type: :model do expect(page.id).to eq("address_matcher") end - it "has the correct header" do - expect(page.header).to eq("Find an address") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/address_spec.rb b/spec/models/form/sales/pages/address_spec.rb index 445ef6220..a4ce72371 100644 --- a/spec/models/form/sales/pages/address_spec.rb +++ b/spec/models/form/sales/pages/address_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Address, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q15 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/age1_spec.rb b/spec/models/form/sales/pages/age1_spec.rb index 227894146..fc4b87880 100644 --- a/spec/models/form/sales/pages/age1_spec.rb +++ b/spec/models/form/sales/pages/age1_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Age1, type: :model do expect(page.id).to eq("buyer_1_age") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/age2_spec.rb b/spec/models/form/sales/pages/age2_spec.rb index 3e18392bf..f324c8ad2 100644 --- a/spec/models/form/sales/pages/age2_spec.rb +++ b/spec/models/form/sales/pages/age2_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Age2, type: :model do expect(page.id).to eq("buyer_2_age") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/armed_forces_spec.rb b/spec/models/form/sales/pages/armed_forces_spec.rb index 2d90c4621..de8c7a9a2 100644 --- a/spec/models/form/sales/pages/armed_forces_spec.rb +++ b/spec/models/form/sales/pages/armed_forces_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ArmedForces, type: :model do expect(page.id).to eq("armed_forces") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/armed_forces_spouse_spec.rb b/spec/models/form/sales/pages/armed_forces_spouse_spec.rb index 6c99fc581..d31a1fe60 100644 --- a/spec/models/form/sales/pages/armed_forces_spouse_spec.rb +++ b/spec/models/form/sales/pages/armed_forces_spouse_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ArmedForcesSpouse, type: :model do expect(page.id).to eq("armed_forces_spouse") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb index 58f8672be..68328a5db 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundArab, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_arab") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb index ad004b5b1..b4c8a198d 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundAsian, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_asian") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb index 0192daf72..7650f49fa 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundBlack, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_black") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb index 84f3bf761..42420774f 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundMixed, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_mixed") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb index 7c1a91bf1..79dddc53a 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundWhite, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_white") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb index 9560aa272..dcc90fe51 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicGroup, type: :model do expect(page.id).to eq("buyer_1_ethnic_group") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb b/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb index e1f21c6d6..48e921468 100644 --- a/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1IncomeMaxValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_1_income_max_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb b/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb index cf47f7420..1736daef7 100644 --- a/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1IncomeMinValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_1_income_min_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer1_income_spec.rb b/spec/models/form/sales/pages/buyer1_income_spec.rb index c339bc142..119a6e2f6 100644 --- a/spec/models/form/sales/pages/buyer1_income_spec.rb +++ b/spec/models/form/sales/pages/buyer1_income_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1Income, type: :model do expect(page.id).to eq("buyer_1_income") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb index 7414d93e1..2f3c92aa7 100644 --- a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1LiveInProperty, type: :model do expect(page.id).to eq("buyer_1_live_in_property") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_mortgage_spec.rb b/spec/models/form/sales/pages/buyer1_mortgage_spec.rb index be66b9446..cb0e23319 100644 --- a/spec/models/form/sales/pages/buyer1_mortgage_spec.rb +++ b/spec/models/form/sales/pages/buyer1_mortgage_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1Mortgage, type: :model do expect(page.id).to eq("buyer_1_mortgage") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_nationality_spec.rb b/spec/models/form/sales/pages/buyer1_nationality_spec.rb index 77a8c966e..a9cb1e381 100644 --- a/spec/models/form/sales/pages/buyer1_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer1_nationality_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::Buyer1Nationality, type: :model do expect(page.id).to eq "buyer_1_nationality" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb b/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb index 0af602b0d..51379136e 100644 --- a/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb +++ b/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb @@ -16,8 +16,4 @@ RSpec.describe Form::Sales::Pages::Buyer1PreviousTenure, type: :model do it "has the correct id" do expect(page.id).to eq("buyer1_previous_tenure") end - - it "has the correct header" do - expect(page.header).to be_nil - end end diff --git a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb index f9d833abf..2ae7f0f1e 100644 --- a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb @@ -18,8 +18,4 @@ RSpec.describe Form::Sales::Pages::Buyer1WorkingSituation, type: :model do it "has the correct id" do expect(page.id).to eq("buyer_1_working_situation") end - - it "has the correct header" do - expect(page.header).to be_nil - end end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb index 2d1509564..1927d728e 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundArab, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_arab") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb index 431204ce5..af17bcaf3 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundAsian, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_asian") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb index 512075579..6d3d2aa19 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundBlack, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_black") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb index e57078caa..3eef3c5bb 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundMixed, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_mixed") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb index dd87bf707..0750c78c8 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundWhite, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_white") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb index 7760124e8..d129508ee 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicGroup, type: :model do expect(page.id).to eq("buyer_2_ethnic_group") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb b/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb index af9ffd88c..440a6bb13 100644 --- a/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2IncomeMaxValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_2_income_max_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb b/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb index fb13de21b..887dcab29 100644 --- a/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2IncomeMinValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_2_income_min_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer2_income_spec.rb b/spec/models/form/sales/pages/buyer2_income_spec.rb index dc08418f2..e77092d55 100644 --- a/spec/models/form/sales/pages/buyer2_income_spec.rb +++ b/spec/models/form/sales/pages/buyer2_income_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2Income, type: :model do expect(page.id).to eq("buyer_2_income") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb b/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb index be5cf65dd..b2eb2386b 100644 --- a/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb +++ b/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2LiveInProperty, type: :model do expect(page.id).to eq("buyer_2_live_in_property") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_living_in_spec.rb b/spec/models/form/sales/pages/buyer2_living_in_spec.rb index f76253a12..972576ab7 100644 --- a/spec/models/form/sales/pages/buyer2_living_in_spec.rb +++ b/spec/models/form/sales/pages/buyer2_living_in_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Sales::Pages::Buyer2LivingIn, type: :model do expect(page.id).to eq("buyer_2_living_in") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_mortgage_spec.rb b/spec/models/form/sales/pages/buyer2_mortgage_spec.rb index d5bd4549b..be342f60f 100644 --- a/spec/models/form/sales/pages/buyer2_mortgage_spec.rb +++ b/spec/models/form/sales/pages/buyer2_mortgage_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2Mortgage, type: :model do expect(page.id).to eq("buyer_2_mortgage") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_nationality_spec.rb b/spec/models/form/sales/pages/buyer2_nationality_spec.rb index 691ba40c3..97b5f7caf 100644 --- a/spec/models/form/sales/pages/buyer2_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer2_nationality_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do expect(page.id).to eq "buyer_2_nationality" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb b/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb index 5c6993daa..37feb8e4f 100644 --- a/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Sales::Pages::Buyer2PreviousHousingSituation, type: :model expect(page.id).to eq("buyer_2_previous_housing_situation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb index 4a7745bb0..96a67f5bf 100644 --- a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2RelationshipToBuyer1, type: :model do expect(page.id).to eq("buyer_2_relationship_to_buyer_1") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_working_situation_spec.rb b/spec/models/form/sales/pages/buyer2_working_situation_spec.rb index 3473308e5..0b7708303 100644 --- a/spec/models/form/sales/pages/buyer2_working_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer2_working_situation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2WorkingSituation, type: :model do expect(page.id).to eq("buyer_2_working_situation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb index 22d1433bc..4bce29312 100644 --- a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do expect(page.id).to eq("buyer_1_live_in_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer_previous_spec.rb b/spec/models/form/sales/pages/buyer_previous_spec.rb index d66c67cc6..d55243dec 100644 --- a/spec/models/form/sales/pages/buyer_previous_spec.rb +++ b/spec/models/form/sales/pages/buyer_previous_spec.rb @@ -24,10 +24,6 @@ RSpec.describe Form::Sales::Pages::BuyerPrevious, type: :model do expect(page.id).to eq("example") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_still_serving_spec.rb b/spec/models/form/sales/pages/buyer_still_serving_spec.rb index 328e364f9..af000539d 100644 --- a/spec/models/form/sales/pages/buyer_still_serving_spec.rb +++ b/spec/models/form/sales/pages/buyer_still_serving_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyerStillServing, type: :model do expect(page.id).to eq("buyer_still_serving") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyers_organisations_spec.rb b/spec/models/form/sales/pages/buyers_organisations_spec.rb index 603dd09ae..86527a0f8 100644 --- a/spec/models/form/sales/pages/buyers_organisations_spec.rb +++ b/spec/models/form/sales/pages/buyers_organisations_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyersOrganisations, type: :model do expect(page.id).to eq("buyers_organisations") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb b/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb index c9834e042..c79cb38da 100644 --- a/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb +++ b/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::CombinedIncomeMaxValueCheck, type: :model do expect(page.id).to eq("prefix_combined_income_max_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/deposit_discount_spec.rb b/spec/models/form/sales/pages/deposit_discount_spec.rb index f4ffb85e5..d183e379b 100644 --- a/spec/models/form/sales/pages/deposit_discount_spec.rb +++ b/spec/models/form/sales/pages/deposit_discount_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::DepositDiscount, type: :model do expect(page.id).to eq("discount") end - it "has the correct header" do - expect(page.header).to eq("About the deposit") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/deposit_spec.rb b/spec/models/form/sales/pages/deposit_spec.rb index 3a3746ac6..b33604176 100644 --- a/spec/models/form/sales/pages/deposit_spec.rb +++ b/spec/models/form/sales/pages/deposit_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to eq("About the deposit") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/deposit_value_check_spec.rb b/spec/models/form/sales/pages/deposit_value_check_spec.rb index 026102ef4..5c4cd3608 100644 --- a/spec/models/form/sales/pages/deposit_value_check_spec.rb +++ b/spec/models/form/sales/pages/deposit_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::DepositValueCheck, type: :model do expect(page.id).to eq("deposit_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/discount_spec.rb b/spec/models/form/sales/pages/discount_spec.rb index 1a38bd634..4585b7f19 100644 --- a/spec/models/form/sales/pages/discount_spec.rb +++ b/spec/models/form/sales/pages/discount_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::Discount, type: :model do expect(page.id).to eq("discount") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/discounted_ownership_type_spec.rb b/spec/models/form/sales/pages/discounted_ownership_type_spec.rb index d3b786e6d..afb4d2757 100644 --- a/spec/models/form/sales/pages/discounted_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/discounted_ownership_type_spec.rb @@ -8,16 +8,6 @@ RSpec.describe Form::Sales::Pages::DiscountedOwnershipType, type: :model do let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:)) } let(:start_date) { Time.zone.today } - describe "headers" do - context "when form year is for 2023/24" do - let(:start_date) { Time.zone.local(2023, 4, 8) } - - it "has the correct header" do - expect(page.header).to eq("Type of discounted ownership sale") - end - end - end - it "has correct subsection" do expect(page.subsection).to eq(subsection) end diff --git a/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb b/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb index ce0d7be8e..38a5f69ae 100644 --- a/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb +++ b/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::DiscountedSaleValueCheck, type: :model do expect(page.id).to eq("discounted_sale_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.discounted_sale_value.title_text", diff --git a/spec/models/form/sales/pages/equity_spec.rb b/spec/models/form/sales/pages/equity_spec.rb index bf620269e..a44085101 100644 --- a/spec/models/form/sales/pages/equity_spec.rb +++ b/spec/models/form/sales/pages/equity_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Equity, type: :model do expect(page.id).to eq("equity") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/exchange_date_spec.rb b/spec/models/form/sales/pages/exchange_date_spec.rb index 979e8634b..3496b17f6 100644 --- a/spec/models/form/sales/pages/exchange_date_spec.rb +++ b/spec/models/form/sales/pages/exchange_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ExchangeDate, type: :model do expect(page.id).to eq("exchange_contracts") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/extra_borrowing_spec.rb b/spec/models/form/sales/pages/extra_borrowing_spec.rb index 609abdb64..eb719c295 100644 --- a/spec/models/form/sales/pages/extra_borrowing_spec.rb +++ b/spec/models/form/sales/pages/extra_borrowing_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ExtraBorrowing, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/gender_identity1_spec.rb b/spec/models/form/sales/pages/gender_identity1_spec.rb index da0e3f07a..69bd79e04 100644 --- a/spec/models/form/sales/pages/gender_identity1_spec.rb +++ b/spec/models/form/sales/pages/gender_identity1_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::GenderIdentity1, type: :model do expect(page.id).to eq("buyer_1_gender_identity") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/gender_identity2_spec.rb b/spec/models/form/sales/pages/gender_identity2_spec.rb index f011ec215..8d9866244 100644 --- a/spec/models/form/sales/pages/gender_identity2_spec.rb +++ b/spec/models/form/sales/pages/gender_identity2_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::GenderIdentity2, type: :model do expect(page.id).to eq("buyer_2_gender_identity") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/grant_spec.rb b/spec/models/form/sales/pages/grant_spec.rb index f88cdf9ae..1b7dd1873 100644 --- a/spec/models/form/sales/pages/grant_spec.rb +++ b/spec/models/form/sales/pages/grant_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Grant, type: :model do expect(page.id).to eq("grant") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/handover_date_check_spec.rb b/spec/models/form/sales/pages/handover_date_check_spec.rb index 9f60fa20f..f245675d5 100644 --- a/spec/models/form/sales/pages/handover_date_check_spec.rb +++ b/spec/models/form/sales/pages/handover_date_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do expect(page.id).to eq("handover_date_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate", diff --git a/spec/models/form/sales/pages/handover_date_spec.rb b/spec/models/form/sales/pages/handover_date_spec.rb index c213959b2..1acc35fbc 100644 --- a/spec/models/form/sales/pages/handover_date_spec.rb +++ b/spec/models/form/sales/pages/handover_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HandoverDate, type: :model do expect(page.id).to eq("handover_date") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/household_disability_spec.rb b/spec/models/form/sales/pages/household_disability_spec.rb index edc8571b7..193ba7f40 100644 --- a/spec/models/form/sales/pages/household_disability_spec.rb +++ b/spec/models/form/sales/pages/household_disability_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HouseholdDisability, type: :model do expect(page.id).to eq("household_disability") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb index 20d0a325f..f0789b54c 100644 --- a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb +++ b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HouseholdWheelchairCheck, type: :model do expect(page.id).to eq("buyer_1_income_mortgage_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/household_wheelchair_spec.rb b/spec/models/form/sales/pages/household_wheelchair_spec.rb index 5c5c0c48c..128ba632f 100644 --- a/spec/models/form/sales/pages/household_wheelchair_spec.rb +++ b/spec/models/form/sales/pages/household_wheelchair_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HouseholdWheelchair, type: :model do expect(page.id).to eq("household_wheelchair") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/housing_benefits_spec.rb b/spec/models/form/sales/pages/housing_benefits_spec.rb index 455f62a0e..c8565f8d7 100644 --- a/spec/models/form/sales/pages/housing_benefits_spec.rb +++ b/spec/models/form/sales/pages/housing_benefits_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::HousingBenefits, type: :model do expect(page.id).to eq(page_id) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/la_nominations_spec.rb b/spec/models/form/sales/pages/la_nominations_spec.rb index 5f403c3e2..b69f88f1f 100644 --- a/spec/models/form/sales/pages/la_nominations_spec.rb +++ b/spec/models/form/sales/pages/la_nominations_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do expect(page.id).to eq("la_nominations") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/last_accommodation_la_spec.rb b/spec/models/form/sales/pages/last_accommodation_la_spec.rb index a0dfff50e..b73cf07f0 100644 --- a/spec/models/form/sales/pages/last_accommodation_la_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_la_spec.rb @@ -22,10 +22,6 @@ RSpec.describe Form::Sales::Pages::LastAccommodationLa, type: :model do expect(page.id).to eq("last_accommodation_la") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/last_accommodation_spec.rb b/spec/models/form/sales/pages/last_accommodation_spec.rb index 094c99282..8c3dbdbbf 100644 --- a/spec/models/form/sales/pages/last_accommodation_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::LastAccommodation, type: :model do expect(page.id).to eq("last_accommodation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/leasehold_charges_spec.rb b/spec/models/form/sales/pages/leasehold_charges_spec.rb index a3f2afa53..b03920d3f 100644 --- a/spec/models/form/sales/pages/leasehold_charges_spec.rb +++ b/spec/models/form/sales/pages/leasehold_charges_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::LeaseholdCharges, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/living_before_purchase_spec.rb b/spec/models/form/sales/pages/living_before_purchase_spec.rb index d12cff216..26026471b 100644 --- a/spec/models/form/sales/pages/living_before_purchase_spec.rb +++ b/spec/models/form/sales/pages/living_before_purchase_spec.rb @@ -35,10 +35,6 @@ RSpec.describe Form::Sales::Pages::LivingBeforePurchase, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb index 5add5d8e7..cb187ecfd 100644 --- a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb +++ b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do expect(page.id).to eq("monthly_charges_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/monthly_rent_spec.rb b/spec/models/form/sales/pages/monthly_rent_spec.rb index 0710f6280..b9e5abe11 100644 --- a/spec/models/form/sales/pages/monthly_rent_spec.rb +++ b/spec/models/form/sales/pages/monthly_rent_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MonthlyRent, type: :model do expect(page.id).to eq("monthly_rent") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/mortgage_amount_spec.rb b/spec/models/form/sales/pages/mortgage_amount_spec.rb index 9400ede28..a6298f1e8 100644 --- a/spec/models/form/sales/pages/mortgage_amount_spec.rb +++ b/spec/models/form/sales/pages/mortgage_amount_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageAmount, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to eq("Mortgage Amount") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/mortgage_lender_other_spec.rb b/spec/models/form/sales/pages/mortgage_lender_other_spec.rb index 93ef4d342..c5effa912 100644 --- a/spec/models/form/sales/pages/mortgage_lender_other_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_other_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageLenderOther, type: :model do expect(page.id).to eq("mortgage_lender_other") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/mortgage_lender_spec.rb b/spec/models/form/sales/pages/mortgage_lender_spec.rb index e0f645d9b..2fac00350 100644 --- a/spec/models/form/sales/pages/mortgage_lender_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageLender, type: :model do expect(page.id).to eq("mortgage_lender") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/mortgage_length_spec.rb b/spec/models/form/sales/pages/mortgage_length_spec.rb index f5d718f5c..7e1ab9f26 100644 --- a/spec/models/form/sales/pages/mortgage_length_spec.rb +++ b/spec/models/form/sales/pages/mortgage_length_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageLength, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/mortgage_value_check_spec.rb b/spec/models/form/sales/pages/mortgage_value_check_spec.rb index f33525652..e4dc11bbc 100644 --- a/spec/models/form/sales/pages/mortgage_value_check_spec.rb +++ b/spec/models/form/sales/pages/mortgage_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::MortgageValueCheck, type: :model do expect(page.id).to eq("buyer_1_income_mortgage_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "is interruption screen page" do expect(page.interruption_screen?).to eq(true) end diff --git a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb index 57d8c2771..890a24e6a 100644 --- a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/no_address_found_spec.rb b/spec/models/form/sales/pages/no_address_found_spec.rb index 79b2bd0ca..1a40abba4 100644 --- a/spec/models/form/sales/pages/no_address_found_spec.rb +++ b/spec/models/form/sales/pages/no_address_found_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::NoAddressFound, type: :model do expect(page.id).to eq("no_address_found") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "address_options_present?" => false, "uprn_known" => nil }, { "address_options_present?" => false, "uprn_known" => 0 }, diff --git a/spec/models/form/sales/pages/number_of_others_in_property_spec.rb b/spec/models/form/sales/pages/number_of_others_in_property_spec.rb index 197f04e67..859aff8e0 100644 --- a/spec/models/form/sales/pages/number_of_others_in_property_spec.rb +++ b/spec/models/form/sales/pages/number_of_others_in_property_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::NumberOfOthersInProperty, type: :model do expect(page.id).to eq("number_of_others_in_property") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb index fce6a5e69..8bc20cef7 100644 --- a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb +++ b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m expect(page.id).to eq("old_persons_shared_ownership_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb index 7535d89ca..fe11bdc86 100644 --- a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb index 6b1fc36a4..5fc3e05ad 100644 --- a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb +++ b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do expect(page.id).to eq("percentage_discount_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.percentage_discount_value.title_text", diff --git a/spec/models/form/sales/pages/person_age_spec.rb b/spec/models/form/sales/pages/person_age_spec.rb index a6ee73e96..0cd79bd02 100644 --- a/spec/models/form/sales/pages/person_age_spec.rb +++ b/spec/models/form/sales/pages/person_age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Sales::Pages::PersonAge, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_gender_identity_spec.rb b/spec/models/form/sales/pages/person_gender_identity_spec.rb index 05a1fe0be..9d7eff2f1 100644 --- a/spec/models/form/sales/pages/person_gender_identity_spec.rb +++ b/spec/models/form/sales/pages/person_gender_identity_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonGenderIdentity, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_known_spec.rb b/spec/models/form/sales/pages/person_known_spec.rb index 82f461f44..141473138 100644 --- a/spec/models/form/sales/pages/person_known_spec.rb +++ b/spec/models/form/sales/pages/person_known_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb index 0fb5503ce..126f2f0b5 100644 --- a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb index c0d1b2734..9185f9f1c 100644 --- a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb +++ b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_working_situation_spec.rb b/spec/models/form/sales/pages/person_working_situation_spec.rb index 9400274f7..53c127e16 100644 --- a/spec/models/form/sales/pages/person_working_situation_spec.rb +++ b/spec/models/form/sales/pages/person_working_situation_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonWorkingSituation, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/postcode_spec.rb b/spec/models/form/sales/pages/postcode_spec.rb index 485411414..8f9c7273c 100644 --- a/spec/models/form/sales/pages/postcode_spec.rb +++ b/spec/models/form/sales/pages/postcode_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Postcode, type: :model do expect(page.id).to eq("property_postcode") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_bedrooms_spec.rb b/spec/models/form/sales/pages/previous_bedrooms_spec.rb index ba9effe69..1899b03bc 100644 --- a/spec/models/form/sales/pages/previous_bedrooms_spec.rb +++ b/spec/models/form/sales/pages/previous_bedrooms_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousBedrooms, type: :model do expect(page.id).to eq("previous_bedrooms") end - it "has the correct header" do - expect(page.header).to eq("About the buyers’ previous property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_ownership_spec.rb b/spec/models/form/sales/pages/previous_ownership_spec.rb index 20433601e..50279956d 100644 --- a/spec/models/form/sales/pages/previous_ownership_spec.rb +++ b/spec/models/form/sales/pages/previous_ownership_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::PreviousOwnership, type: :model do expect(page.id).to eq("example_id") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_property_type_spec.rb b/spec/models/form/sales/pages/previous_property_type_spec.rb index 317421255..357e7dc2e 100644 --- a/spec/models/form/sales/pages/previous_property_type_spec.rb +++ b/spec/models/form/sales/pages/previous_property_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousPropertyType, type: :model do expect(page.id).to eq("previous_property_type") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/previous_shared_spec.rb b/spec/models/form/sales/pages/previous_shared_spec.rb index de7ef9948..e8da9bcd2 100644 --- a/spec/models/form/sales/pages/previous_shared_spec.rb +++ b/spec/models/form/sales/pages/previous_shared_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousShared, type: :model do expect(page.id).to eq("previous_shared") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_tenure_spec.rb b/spec/models/form/sales/pages/previous_tenure_spec.rb index cd5b0733d..1dc5ec772 100644 --- a/spec/models/form/sales/pages/previous_tenure_spec.rb +++ b/spec/models/form/sales/pages/previous_tenure_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousTenure, type: :model do expect(page.id).to eq("shared_ownership_previous_tenure") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb index fc34d42de..774b7f3b9 100644 --- a/spec/models/form/sales/pages/privacy_notice_spec.rb +++ b/spec/models/form/sales/pages/privacy_notice_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do expect(page.id).to eq("privacy_notice") end - it "has the correct header" do - expect(page.header).to eq("Ministry of Housing, Communities and Local Government privacy notice") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_building_type_spec.rb b/spec/models/form/sales/pages/property_building_type_spec.rb index 6dc653303..aac8fbf24 100644 --- a/spec/models/form/sales/pages/property_building_type_spec.rb +++ b/spec/models/form/sales/pages/property_building_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PropertyBuildingType, type: :model do expect(page.id).to eq("property_building_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb index 6d94beed0..016d0534d 100644 --- a/spec/models/form/sales/pages/property_local_authority_spec.rb +++ b/spec/models/form/sales/pages/property_local_authority_spec.rb @@ -48,10 +48,6 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do expect(page.id).to eq("property_local_authority") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb b/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb index 6ab6719d7..5fdb6d0d6 100644 --- a/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb +++ b/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PropertyNumberOfBedrooms, type: :model do expect(page.id).to eq("property_number_of_bedrooms") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_unit_type_spec.rb b/spec/models/form/sales/pages/property_unit_type_spec.rb index 280c27cb5..24bb3ce54 100644 --- a/spec/models/form/sales/pages/property_unit_type_spec.rb +++ b/spec/models/form/sales/pages/property_unit_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PropertyUnitType, type: :model do expect(page.id).to eq("property_unit_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb index a77c26af2..9d60c5f3c 100644 --- a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do expect(page.id).to eq("property_wheelchair_accessible") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb b/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb index 1aefb1e43..27ab0b422 100644 --- a/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PurchasePriceOutrightOwnership, type: :model expect(page.id).to eq("purchase_price") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/purchase_price_spec.rb b/spec/models/form/sales/pages/purchase_price_spec.rb index 57cf526ad..e5bfb176a 100644 --- a/spec/models/form/sales/pages/purchase_price_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::PurchasePrice, type: :model do expect(page.id).to eq("purchase_price") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/resale_spec.rb b/spec/models/form/sales/pages/resale_spec.rb index ec4fcd218..3916a26e5 100644 --- a/spec/models/form/sales/pages/resale_spec.rb +++ b/spec/models/form/sales/pages/resale_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Resale, type: :model do expect(page.id).to eq("resale") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/retirement_value_check_spec.rb b/spec/models/form/sales/pages/retirement_value_check_spec.rb index b09760ff5..6df7a379b 100644 --- a/spec/models/form/sales/pages/retirement_value_check_spec.rb +++ b/spec/models/form/sales/pages/retirement_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/sale_date_check_spec.rb b/spec/models/form/sales/pages/sale_date_check_spec.rb index d87a4be45..c8d9d4c5f 100644 --- a/spec/models/form/sales/pages/sale_date_check_spec.rb +++ b/spec/models/form/sales/pages/sale_date_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SaleDateCheck, type: :model do expect(page.id).to eq("completion_date_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.saledate.must_be_less_than_3_years_from_hodate", diff --git a/spec/models/form/sales/pages/savings_spec.rb b/spec/models/form/sales/pages/savings_spec.rb index 93032ef31..3dca07e8d 100644 --- a/spec/models/form/sales/pages/savings_spec.rb +++ b/spec/models/form/sales/pages/savings_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Savings, type: :model do expect(page.id).to eq("savings") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/savings_value_check_spec.rb b/spec/models/form/sales/pages/savings_value_check_spec.rb index 7f530e3c6..81672977d 100644 --- a/spec/models/form/sales/pages/savings_value_check_spec.rb +++ b/spec/models/form/sales/pages/savings_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SavingsValueCheck, type: :model do expect(page.id).to eq("savings_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { "not_joint_purchase?" => true, diff --git a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb index 0b671fe9c..3a1c22f24 100644 --- a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode expect(page.id).to eq("shared_ownership_deposit_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb index 74ad00e7e..95e59ea4e 100644 --- a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb +++ b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do expect(page.id).to eq("an_id") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "staircase_owned_out_of_soft_range?" => true, diff --git a/spec/models/form/sales/pages/staircase_spec.rb b/spec/models/form/sales/pages/staircase_spec.rb index fa17aeede..6f17e7e89 100644 --- a/spec/models/form/sales/pages/staircase_spec.rb +++ b/spec/models/form/sales/pages/staircase_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do expect(page.id).to eq("staircasing") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/uprn_confirmation_spec.rb b/spec/models/form/sales/pages/uprn_confirmation_spec.rb index bd52233b6..9550b9f49 100644 --- a/spec/models/form/sales/pages/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/pages/uprn_confirmation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::UprnConfirmation, type: :model do expect(page.id).to eq("uprn_confirmation") end - it "has the correct header" do - expect(page.header).to eq("We found an address that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/uprn_selection_spec.rb b/spec/models/form/sales/pages/uprn_selection_spec.rb index 2e3f3e8f6..22e95bdf4 100644 --- a/spec/models/form/sales/pages/uprn_selection_spec.rb +++ b/spec/models/form/sales/pages/uprn_selection_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::UprnSelection, type: :model do expect(page.id).to eq("uprn_selection") end - it "has the correct header" do - expect(page.header).to eq("We found some addresses that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/uprn_spec.rb b/spec/models/form/sales/pages/uprn_spec.rb index 8511af372..17ef3179b 100644 --- a/spec/models/form/sales/pages/uprn_spec.rb +++ b/spec/models/form/sales/pages/uprn_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do expect(page.id).to eq("uprn") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/value_shared_ownership_spec.rb b/spec/models/form/sales/pages/value_shared_ownership_spec.rb index 58a40b2cd..f8232894b 100644 --- a/spec/models/form/sales/pages/value_shared_ownership_spec.rb +++ b/spec/models/form/sales/pages/value_shared_ownership_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ValueSharedOwnership, type: :model do expect(page.id).to eq("value_shared_ownership") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb b/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb index 0272d1329..067b78717 100644 --- a/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb +++ b/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb @@ -16,18 +16,10 @@ RSpec.describe Form::Sales::Questions::AddressLine1ForAddressMatcher, type: :mod expect(question.id).to eq("address_line1_input") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Find address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -40,10 +32,6 @@ RSpec.describe Form::Sales::Questions::AddressLine1ForAddressMatcher, type: :mod expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("Address line 1\nAA1 1AA") end diff --git a/spec/models/form/sales/questions/address_line1_spec.rb b/spec/models/form/sales/questions/address_line1_spec.rb index 520587cb3..c64297f48 100644 --- a/spec/models/form/sales/questions/address_line1_spec.rb +++ b/spec/models/form/sales/questions/address_line1_spec.rb @@ -15,18 +15,10 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do expect(question.id).to eq("address_line1") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Address lines 1 and 2") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -39,10 +31,6 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/address_line2_spec.rb b/spec/models/form/sales/questions/address_line2_spec.rb index 52f7cc0fd..153582204 100644 --- a/spec/models/form/sales/questions/address_line2_spec.rb +++ b/spec/models/form/sales/questions/address_line2_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::AddressLine2, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } @@ -15,14 +17,6 @@ RSpec.describe Form::Sales::Questions::AddressLine2, type: :model do expect(question.id).to eq("address_line2") end - it "has the correct header" do - expect(question.header).to eq("Address line 2 (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +25,6 @@ RSpec.describe Form::Sales::Questions::AddressLine2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/age1_spec.rb b/spec/models/form/sales/questions/age1_spec.rb index d7529ef27..5c5486717 100644 --- a/spec/models/form/sales/questions/age1_spec.rb +++ b/spec/models/form/sales/questions/age1_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Age1, type: :model do expect(question.id).to eq("age1") end - it "has the correct header" do - expect(question.header).to eq("Age") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Age1, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(2) end diff --git a/spec/models/form/sales/questions/age2_spec.rb b/spec/models/form/sales/questions/age2_spec.rb index e1cd82297..8578b51d5 100644 --- a/spec/models/form/sales/questions/age2_spec.rb +++ b/spec/models/form/sales/questions/age2_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Age2, type: :model do expect(question.id).to eq("age2") end - it "has the correct header" do - expect(question.header).to eq("Age") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Age2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(2) end diff --git a/spec/models/form/sales/questions/armed_forces_spec.rb b/spec/models/form/sales/questions/armed_forces_spec.rb index f775c800c..234a25e71 100644 --- a/spec/models/form/sales/questions/armed_forces_spec.rb +++ b/spec/models/form/sales/questions/armed_forces_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ArmedForces, type: :model do expect(question.id).to eq("hhregres") end - it "has the correct header" do - expect(question.header).to eq("Have any of the buyers ever served as a regular in the UK armed forces?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Have any of the buyers ever served as a regular in the UK armed forces?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::ArmedForces, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/armed_forces_spouse_spec.rb b/spec/models/form/sales/questions/armed_forces_spouse_spec.rb index 92ae3df0c..6808bbb2a 100644 --- a/spec/models/form/sales/questions/armed_forces_spouse_spec.rb +++ b/spec/models/form/sales/questions/armed_forces_spouse_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ArmedForcesSpouse, type: :model do expect(question.id).to eq("armedforcesspouse") end - it "has the correct header" do - expect(question.header).to eq("Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::ArmedForcesSpouse, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer1_age_known_spec.rb b/spec/models/form/sales/questions/buyer1_age_known_spec.rb index 5c3c0ba56..e79d6b2c2 100644 --- a/spec/models/form/sales/questions/buyer1_age_known_spec.rb +++ b/spec/models/form/sales/questions/buyer1_age_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1AgeKnown, type: :model do expect(question.id).to eq("age1_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 1’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s age") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -45,10 +37,6 @@ RSpec.describe Form::Sales::Questions::Buyer1AgeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has correct hidden_in_check_answers for" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb index 8cf7d0e81..593a525d2 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Arab background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "16" => { "value" => "Other ethnic group" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb index 8603badf7..f49d64437 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Asian or Asian British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "10" => { "value" => "Bangladeshi" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb index 403d68b78..6afe4eaf5 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "12" => { "value" => "Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb index 9a0357d60..d6e51de58 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "White and Black Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb index 0feae47b7..d08ece820 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s White background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -48,10 +40,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end end context "with 2024/25 form" do @@ -68,10 +56,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end end it "has the correct check_answers_card_number" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb index 552f45244..0bdc6d9c0 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicGroup, type: :model do expect(question.id).to eq("ethnic_group") end - it "has the correct header" do - expect(question.header).to eq("What is buyer 1’s ethnic group?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic group") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicGroup, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "White" }, diff --git a/spec/models/form/sales/questions/buyer1_income_known_spec.rb b/spec/models/form/sales/questions/buyer1_income_known_spec.rb index 644bb3e55..4f1c8b445 100644 --- a/spec/models/form/sales/questions/buyer1_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeKnown, type: :model do expect(question.id).to eq("income1nk") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 1’s annual income?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gross annual income known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer1_income_spec.rb b/spec/models/form/sales/questions/buyer1_income_spec.rb index 7bf56762b..4c9a10295 100644 --- a/spec/models/form/sales/questions/buyer1_income_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do expect(question.id).to eq("income1") end - it "has the correct header" do - expect(question.header).to eq("Buyer 1’s gross annual income") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gross annual income") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments.") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb b/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb index 31f249114..e8cc3410a 100644 --- a/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeValueCheck, type: :model do expect(question.id).to eq("income1_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1 income confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb index 151e4c42d..eccb172f7 100644 --- a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1LiveInProperty, type: :model do expect(question.id).to eq("buy1livein") end - it "has the correct header" do - expect(question.header).to eq("Will buyer 1 live in the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Will buyer 1 live in the property?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,10 +34,6 @@ RSpec.describe Form::Sales::Questions::Buyer1LiveInProperty, type: :model do expect(question.conditional_for).to be_nil end - it "has the correct hint" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer1_mortgage_spec.rb b/spec/models/form/sales/questions/buyer1_mortgage_spec.rb index a0790c7f8..6bdad4a4f 100644 --- a/spec/models/form/sales/questions/buyer1_mortgage_spec.rb +++ b/spec/models/form/sales/questions/buyer1_mortgage_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Mortgage, type: :model do expect(question.id).to eq("inc1mort") end - it "has the correct header" do - expect(question.header).to eq("Was buyer 1’s income used for a mortgage application?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s income used for mortgage application") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer1_nationality_spec.rb b/spec/models/form/sales/questions/buyer1_nationality_spec.rb index b27124fbc..557b97b2e 100644 --- a/spec/models/form/sales/questions/buyer1_nationality_spec.rb +++ b/spec/models/form/sales/questions/buyer1_nationality_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Nationality, type: :model do expect(question.id).to eq "national" end - it "has the correct header" do - expect(question.header).to eq "What is buyer 1’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 1’s nationality" - end - it "has the correct type" do expect(question.type).to eq "radio" end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Nationality, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "18" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb b/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb index 6a8197370..85742b9a6 100644 --- a/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb +++ b/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Sales::Questions::Buyer1PreviousTenure, type: :model do expect(question.id).to eq("prevten") end - it "has the correct header" do - expect(question.header).to eq("What was buyer 1’s previous tenure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s previous tenure") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb index 908d12a51..c99e64527 100644 --- a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1WorkingSituation, type: :model do expect(question.id).to eq("ecstat1") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 1's working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1's working situation") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_age_known_spec.rb b/spec/models/form/sales/questions/buyer2_age_known_spec.rb index 68a8d01b4..2f62bce95 100644 --- a/spec/models/form/sales/questions/buyer2_age_known_spec.rb +++ b/spec/models/form/sales/questions/buyer2_age_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2AgeKnown, type: :model do expect(question.id).to eq("age2_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 2’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s age") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb index ea6c3cc64..0ceb9b61a 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundArab, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Arab background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundArab, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "16" => { "value" => "Other ethnic group" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb index 32715afdd..9335c6b15 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundAsian, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Asian or Asian British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundAsian, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "10" => { "value" => "Bangladeshi" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb index 820e7cb7a..d9675a051 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundBlack, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundBlack, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "12" => { "value" => "Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb index 96f621a0c..1c6b4e8f1 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundMixed, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundMixed, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "White and Black Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb index 3ff9c7f3c..8d81e8897 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s White background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - context "with 2023/24 form" do it "has the correct answer_options" do expect(question.answer_options).to eq({ diff --git a/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb index a94cf56e7..c83e30816 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicGroup, type: :model do expect(question.id).to eq("ethnic_group2") end - it "has the correct header" do - expect(question.header).to eq("What is buyer 2’s ethnic group?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic group") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicGroup, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "White" }, diff --git a/spec/models/form/sales/questions/buyer2_income_known_spec.rb b/spec/models/form/sales/questions/buyer2_income_known_spec.rb index 9c6a8a51a..82418f796 100644 --- a/spec/models/form/sales/questions/buyer2_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeKnown, type: :model do expect(question.id).to eq("income2nk") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 2’s annual income?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gross annual income known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_income_spec.rb b/spec/models/form/sales/questions/buyer2_income_spec.rb index f13c51a06..ecd8aecf4 100644 --- a/spec/models/form/sales/questions/buyer2_income_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Income, type: :model do expect(question.id).to eq("income2") end - it "has the correct header" do - expect(question.header).to eq("Buyer 2’s gross annual income") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gross annual income") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Income, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments.") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb b/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb index 8b0fd4328..80f9793b5 100644 --- a/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeValueCheck, type: :model do expect(question.id).to eq("income2_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2 income confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end diff --git a/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb b/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb index fb464e6d2..a201b660c 100644 --- a/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb +++ b/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LiveInProperty, type: :model do expect(question.id).to eq("buy2livein") end - it "has the correct header" do - expect(question.header).to eq("Will buyer 2 live in the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Will buyer 2 live in the property?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LiveInProperty, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer2_living_in_spec.rb b/spec/models/form/sales/questions/buyer2_living_in_spec.rb index 4de3f0bcf..4e524fc18 100644 --- a/spec/models/form/sales/questions/buyer2_living_in_spec.rb +++ b/spec/models/form/sales/questions/buyer2_living_in_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LivingIn, type: :model do expect(question.id).to eq "buy2living" end - it "has the correct header" do - expect(question.header).to eq "At the time of purchase, was buyer 2 living at the same address as buyer 1?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2 living at the same address" - end - it "has the correct type" do expect(question.type).to eq "radio" end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LivingIn, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq "" - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer2_mortgage_spec.rb b/spec/models/form/sales/questions/buyer2_mortgage_spec.rb index d96f094e2..761c80a34 100644 --- a/spec/models/form/sales/questions/buyer2_mortgage_spec.rb +++ b/spec/models/form/sales/questions/buyer2_mortgage_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Mortgage, type: :model do expect(question.id).to eq("inc2mort") end - it "has the correct header" do - expect(question.header).to eq("Was buyer 2’s income used for a mortgage application?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s income used for mortgage application") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_nationality_spec.rb b/spec/models/form/sales/questions/buyer2_nationality_spec.rb index 66def77bf..d6d7cae38 100644 --- a/spec/models/form/sales/questions/buyer2_nationality_spec.rb +++ b/spec/models/form/sales/questions/buyer2_nationality_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Nationality, type: :model do expect(question.id).to eq "nationalbuy2" end - it "has the correct header" do - expect(question.header).to eq "What is buyer 2’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2’s nationality" - end - it "has the correct type" do expect(question.type).to eq "radio" end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Nationality, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "18" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb index a4f5ad962..1d478faa9 100644 --- a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model expect(question.id).to eq("relat2") end - it "has the correct header" do - expect(question.header).to eq("What is buyer 2's relationship to buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2's relationship to buyer 1") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "P" => { "value" => "Partner" }, diff --git a/spec/models/form/sales/questions/buyer2_working_situation_spec.rb b/spec/models/form/sales/questions/buyer2_working_situation_spec.rb index 5a27e1b5e..81d1e052f 100644 --- a/spec/models/form/sales/questions/buyer2_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer2_working_situation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2WorkingSituation, type: :model do expect(question.id).to eq("ecstat2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 2's working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2's working situation") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2WorkingSituation, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Full-time - 30 hours or more" }, diff --git a/spec/models/form/sales/questions/buyer_company_spec.rb b/spec/models/form/sales/questions/buyer_company_spec.rb index 5bf652db4..c0284c3a2 100644 --- a/spec/models/form/sales/questions/buyer_company_spec.rb +++ b/spec/models/form/sales/questions/buyer_company_spec.rb @@ -15,10 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyerCompany, type: :model do expect(question.id).to eq("companybuy") end - it "has the correct header" do - expect(question.header).to eq("Is the buyer a company?") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb b/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb index 9a0ba99c8..984735fe6 100644 --- a/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb +++ b/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::BuyerLiveInValueCheck, type: :model do expect(question.id).to eq("buyer_livein_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer live in confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -32,10 +24,6 @@ RSpec.describe Form::Sales::Questions::BuyerLiveInValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer_previous_spec.rb b/spec/models/form/sales/questions/buyer_previous_spec.rb index ef46d2fd0..8c37c2ff2 100644 --- a/spec/models/form/sales/questions/buyer_previous_spec.rb +++ b/spec/models/form/sales/questions/buyer_previous_spec.rb @@ -23,28 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do expect(question.id).to eq("soctenant") end - context "when a joint purchase" do - it "has the correct header" do - expect(question.header).to eq("Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Any buyers were registered providers, housing association or local authority tenants immediately before this sale?") - end - end - - context "when not a joint purchase" do - let(:joint_purchase) { false } - - it "has the correct header" do - expect(question.header).to eq("Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer was a registered provider, housing association or local authority tenant immediately before this sale?") - end - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -68,10 +46,6 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do expect(question.conditional_for).to eq(nil) end - it "has the correct hint" do - expect(question.hint_text).to eq(nil) - end - context "when form year is before 2024" do before do allow(form).to receive(:start_year_after_2024?).and_return(false) diff --git a/spec/models/form/sales/questions/buyer_still_serving_spec.rb b/spec/models/form/sales/questions/buyer_still_serving_spec.rb index 64b6ad79f..961da2ce9 100644 --- a/spec/models/form/sales/questions/buyer_still_serving_spec.rb +++ b/spec/models/form/sales/questions/buyer_still_serving_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyerStillServing, type: :model do expect(question.id).to eq("hhregresstill") end - it "has the correct header" do - expect(question.header).to eq("Is the buyer still serving in the UK armed forces?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Are they still serving in the UK armed forces?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyerStillServing, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyers_organisations_spec.rb b/spec/models/form/sales/questions/buyers_organisations_spec.rb index c997c5883..03489f59d 100644 --- a/spec/models/form/sales/questions/buyers_organisations_spec.rb +++ b/spec/models/form/sales/questions/buyers_organisations_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyersOrganisations, type: :model do expect(question.id).to eq("buyers_organisations") end - it "has the correct header" do - expect(question.header).to eq("What organisations were the buyers registered with?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Organisations buyers were registered with") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyersOrganisations, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq( { diff --git a/spec/models/form/sales/questions/combined_income_value_check_spec.rb b/spec/models/form/sales/questions/combined_income_value_check_spec.rb index a47b8a4b3..5ddacfff5 100644 --- a/spec/models/form/sales/questions/combined_income_value_check_spec.rb +++ b/spec/models/form/sales/questions/combined_income_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::CombinedIncomeValueCheck, type: :model do expect(question.id).to eq("combined_income_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Combined income confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::CombinedIncomeValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(nil) end diff --git a/spec/models/form/sales/questions/county_spec.rb b/spec/models/form/sales/questions/county_spec.rb index 0961cba38..650e43165 100644 --- a/spec/models/form/sales/questions/county_spec.rb +++ b/spec/models/form/sales/questions/county_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::County, type: :model do expect(question.id).to eq("county") end - it "has the correct header" do - expect(question.header).to eq("County (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("County") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::County, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/deposit_amount_spec.rb b/spec/models/form/sales/questions/deposit_amount_spec.rb index acfab8af7..95404971a 100644 --- a/spec/models/form/sales/questions/deposit_amount_spec.rb +++ b/spec/models/form/sales/questions/deposit_amount_spec.rb @@ -51,22 +51,4 @@ RSpec.describe Form::Sales::Questions::DepositAmount, type: :model do end end end - - describe "hint text" do - context "when optional is false" do - let(:optional) { false } - - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan") - end - end - - context "when optional is true" do - let(:optional) { true } - - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue") - end - end - end end diff --git a/spec/models/form/sales/questions/deposit_discount_spec.rb b/spec/models/form/sales/questions/deposit_discount_spec.rb index add79d0ed..8d3ceb45b 100644 --- a/spec/models/form/sales/questions/deposit_discount_spec.rb +++ b/spec/models/form/sales/questions/deposit_discount_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::DepositDiscount, type: :model do expect(question.id).to eq("cashdis") end - it "has the correct header" do - expect(question.header).to eq("How much cash discount was given through Social HomeBuy?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Cash discount through SocialHomeBuy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::DepositDiscount, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/deposit_value_check_spec.rb b/spec/models/form/sales/questions/deposit_value_check_spec.rb index 765782f57..2e861110a 100644 --- a/spec/models/form/sales/questions/deposit_value_check_spec.rb +++ b/spec/models/form/sales/questions/deposit_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do expect(question.id).to eq("deposit_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure that the deposit is this much higher than the buyer's savings?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Deposit confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/sales/questions/discount_spec.rb b/spec/models/form/sales/questions/discount_spec.rb index 0df9175ff..5037e2b4e 100644 --- a/spec/models/form/sales/questions/discount_spec.rb +++ b/spec/models/form/sales/questions/discount_spec.rb @@ -21,14 +21,6 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do expect(question.id).to eq("discount") end - it "has the correct header" do - expect(question.header).to eq("What was the percentage discount?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage discount") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -37,12 +29,6 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

- If discount capped, enter capped %

- If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given.") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/discounted_ownership_type_spec.rb b/spec/models/form/sales/questions/discounted_ownership_type_spec.rb index 442d015a6..43ecb4ac5 100644 --- a/spec/models/form/sales/questions/discounted_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/discounted_ownership_type_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Sales::Questions::DiscountedOwnershipType, type: :model do expect(question.id).to eq("type") end - it "has the correct header" do - expect(question.header).to eq("What is the type of discounted ownership sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of discounted ownership sale") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb b/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb index bb247af4a..09170a225 100644 --- a/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb +++ b/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::DiscountedSaleValueCheck, type: :model do expect(question.id).to eq("discounted_sale_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Discounted sale value confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::DiscountedSaleValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/equity_spec.rb b/spec/models/form/sales/questions/equity_spec.rb index ad80eef50..f58c042f5 100644 --- a/spec/models/form/sales/questions/equity_spec.rb +++ b/spec/models/form/sales/questions/equity_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Equity, type: :model do expect(question.id).to eq("equity") end - it "has the correct header" do - expect(question.header).to eq("What was the initial percentage equity stake purchased?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Initial percentage equity stake") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Equity, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/exchange_date_spec.rb b/spec/models/form/sales/questions/exchange_date_spec.rb index 777e5596c..802b9798d 100644 --- a/spec/models/form/sales/questions/exchange_date_spec.rb +++ b/spec/models/form/sales/questions/exchange_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ExchangeDate, type: :model do expect(question.id).to eq("exdate") end - it "has the correct header" do - expect(question.header).to eq("What is the exchange of contracts date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Exchange of contracts date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/sales/questions/extra_borrowing_spec.rb b/spec/models/form/sales/questions/extra_borrowing_spec.rb index 59c962c63..7cea7103b 100644 --- a/spec/models/form/sales/questions/extra_borrowing_spec.rb +++ b/spec/models/form/sales/questions/extra_borrowing_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do expect(question.id).to eq("extrabor") end - it "has the correct header" do - expect(question.header).to eq("Does this include any extra borrowing?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Any other borrowing?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("") - end end diff --git a/spec/models/form/sales/questions/fromprop_spec.rb b/spec/models/form/sales/questions/fromprop_spec.rb index 5660cbd91..b6caeacd0 100644 --- a/spec/models/form/sales/questions/fromprop_spec.rb +++ b/spec/models/form/sales/questions/fromprop_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Fromprop, type: :model do expect(question.id).to eq("fromprop") end - it "has the correct header" do - expect(question.header).to eq("What was the previous property type?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Previous property type") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Fromprop, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has the correct displayed_answer_options" do expect(question.displayed_answer_options(nil)).to eq({ "1" => { "value" => "Flat or maisonette" }, diff --git a/spec/models/form/sales/questions/gender_identity1_spec.rb b/spec/models/form/sales/questions/gender_identity1_spec.rb index 89989a20f..16a7eeca5 100644 --- a/spec/models/form/sales/questions/gender_identity1_spec.rb +++ b/spec/models/form/sales/questions/gender_identity1_spec.rb @@ -22,14 +22,6 @@ RSpec.describe Form::Sales::Questions::GenderIdentity1, type: :model do expect(question.id).to eq("sex1") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 1’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gender identity") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -50,24 +42,4 @@ RSpec.describe Form::Sales::Questions::GenderIdentity1, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end - - context "with start year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - end - - context "with start year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end end diff --git a/spec/models/form/sales/questions/gender_identity2_spec.rb b/spec/models/form/sales/questions/gender_identity2_spec.rb index 92ebb4758..486f938a9 100644 --- a/spec/models/form/sales/questions/gender_identity2_spec.rb +++ b/spec/models/form/sales/questions/gender_identity2_spec.rb @@ -22,14 +22,6 @@ RSpec.describe Form::Sales::Questions::GenderIdentity2, type: :model do expect(question.id).to eq("sex2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 2’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gender identity") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -56,24 +48,4 @@ RSpec.describe Form::Sales::Questions::GenderIdentity2, type: :model do { "condition" => { "sex2" => "R" }, "value" => "Prefers not to say" }, ]) end - - context "with start year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - end - - context "with start year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end end diff --git a/spec/models/form/sales/questions/grant_spec.rb b/spec/models/form/sales/questions/grant_spec.rb index 124ade07e..b7c0381a1 100644 --- a/spec/models/form/sales/questions/grant_spec.rb +++ b/spec/models/form/sales/questions/grant_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Grant, type: :model do expect(question.id).to eq("grant") end - it "has the correct header" do - expect(question.header).to eq("What was the amount of any loan, grant, discount or subsidy given?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Amount of any loan, grant or subsidy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Grant, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/handover_date_check_spec.rb b/spec/models/form/sales/questions/handover_date_check_spec.rb index d59764567..87905545a 100644 --- a/spec/models/form/sales/questions/handover_date_check_spec.rb +++ b/spec/models/form/sales/questions/handover_date_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HandoverDateCheck, type: :model do expect(question.id).to eq("hodate_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Practical completion or handover date check") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::HandoverDateCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/handover_date_spec.rb b/spec/models/form/sales/questions/handover_date_spec.rb index 94119ea32..cd76ec1c0 100644 --- a/spec/models/form/sales/questions/handover_date_spec.rb +++ b/spec/models/form/sales/questions/handover_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HandoverDate, type: :model do expect(question.id).to eq("hodate") end - it "has the correct header" do - expect(question.header).to eq("What is the practical completion or handover date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Practical completion or handover date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/sales/questions/has_leasehold_charges_spec.rb b/spec/models/form/sales/questions/has_leasehold_charges_spec.rb index 2d1034d57..ea5c090a0 100644 --- a/spec/models/form/sales/questions/has_leasehold_charges_spec.rb +++ b/spec/models/form/sales/questions/has_leasehold_charges_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HasLeaseholdCharges, type: :model do expect(question.id).to eq("has_mscharge") end - it "has the correct header" do - expect(question.header).to eq("Does the property have any monthly leasehold charges?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Does the property have any monthly leasehold charges?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::HasLeaseholdCharges, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("For example, service and management charges") - end - it "has correct hidden_in_check_answers for" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/household_disability_spec.rb b/spec/models/form/sales/questions/household_disability_spec.rb index 75a100595..ccb4b7017 100644 --- a/spec/models/form/sales/questions/household_disability_spec.rb +++ b/spec/models/form/sales/questions/household_disability_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HouseholdDisability, type: :model do expect(question.id).to eq("disabled") end - it "has the correct header" do - expect(question.header).to eq("Does anyone in the household consider themselves to have a disability?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Does anyone in the household have a disability?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::HouseholdDisability, type: :model do it "has correct conditional for" do expect(question.conditional_for).to be_nil end - - it "has the correct hint" do - expect(question.hint_text).to eq("This includes any long-term health condition that has an impact on the person's day-to-day life") - end end diff --git a/spec/models/form/sales/questions/household_wheelchair_check_spec.rb b/spec/models/form/sales/questions/household_wheelchair_check_spec.rb index a5e01a5f9..d059fc2e8 100644 --- a/spec/models/form/sales/questions/household_wheelchair_check_spec.rb +++ b/spec/models/form/sales/questions/household_wheelchair_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchairCheck, type: :model do expect(question.id).to eq("wheel_value_check") end - it "has the correct header" do - expect(question.header).to eq("You told us that someone in the household uses a wheelchair.") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Does anyone in the household use a wheelchair?") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchairCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/household_wheelchair_spec.rb b/spec/models/form/sales/questions/household_wheelchair_spec.rb index 0e12f37d0..8530d52f5 100644 --- a/spec/models/form/sales/questions/household_wheelchair_spec.rb +++ b/spec/models/form/sales/questions/household_wheelchair_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchair, type: :model do expect(question.id).to eq("wheel") end - it "has the correct header" do - expect(question.header).to eq("Does anyone in the household use a wheelchair?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchair, type: :model do it "has correct conditional for" do expect(question.conditional_for).to be_nil end - - it "has the correct hint" do - expect(question.hint_text).to eq("This can be inside or outside the home") - end end diff --git a/spec/models/form/sales/questions/housing_benefits_spec.rb b/spec/models/form/sales/questions/housing_benefits_spec.rb index 9a50d053d..21a84a6b8 100644 --- a/spec/models/form/sales/questions/housing_benefits_spec.rb +++ b/spec/models/form/sales/questions/housing_benefits_spec.rb @@ -16,24 +16,6 @@ RSpec.describe Form::Sales::Questions::HousingBenefits, type: :model do expect(question.id).to eq("hb") end - context "when joint purchase is false" do - it "has the correct header" do - expect(question.header).to eq("Was the buyer receiving any of these housing-related benefits immediately before buying this property?") - end - end - - context "when joint purchase is true" do - let(:joint_purchase) { true } - - it "has the correct header" do - expect(question.header).to eq("Were the buyers receiving any of these housing-related benefits immediately before buying this property?") - end - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Housing-related benefits buyer received before buying this property") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,10 +24,6 @@ RSpec.describe Form::Sales::Questions::HousingBenefits, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Housing benefit" }, diff --git a/spec/models/form/sales/questions/la_nominations_spec.rb b/spec/models/form/sales/questions/la_nominations_spec.rb index 46c2be023..2bbd4e9ee 100644 --- a/spec/models/form/sales/questions/la_nominations_spec.rb +++ b/spec/models/form/sales/questions/la_nominations_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::LaNominations, type: :model do expect(question.id).to eq("lanomagr") end - it "has the correct header" do - expect(question.header).to eq("Was the household rehoused under a 'local authority nominations agreement'?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Household rehoused under a local authority nominations agreement?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::LaNominations, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing") - end end diff --git a/spec/models/form/sales/questions/leasehold_charges_spec.rb b/spec/models/form/sales/questions/leasehold_charges_spec.rb index 59a0a8658..35c2dd589 100644 --- a/spec/models/form/sales/questions/leasehold_charges_spec.rb +++ b/spec/models/form/sales/questions/leasehold_charges_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::LeaseholdCharges, type: :model do expect(question.id).to eq("mscharge") end - it "has the correct header" do - expect(question.header).to eq("Enter the total monthly charge") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Monthly leasehold charges") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::LeaseholdCharges, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to be 5 end diff --git a/spec/models/form/sales/questions/living_before_purchase_spec.rb b/spec/models/form/sales/questions/living_before_purchase_spec.rb index 8c7a8caae..9ac76887a 100644 --- a/spec/models/form/sales/questions/living_before_purchase_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do expect(question.id).to eq("proplen_asked") end - it "has the correct header" do - expect(question.header).to eq("Did the buyer live in the property before purchasing it?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer lived in the property before purchasing") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq("0" => { "value" => "Yes" }, "1" => { "value" => "No" }) diff --git a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb index 455441a5d..c9893dece 100644 --- a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb @@ -20,14 +20,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.id).to eq("proplen") end - it "has the correct header" do - expect(question.header).to eq("How long did the buyer(s) live in the property before purchase?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of years living in the property before purchase") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -36,10 +28,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You should round this up to the nearest year. If the buyers haven't been living in the property, enter '0'") - end - it "has correct width" do expect(question.width).to eq(5) end @@ -68,14 +56,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.id).to eq("proplen") end - it "has the correct header" do - expect(question.header).to eq("How long did they live there?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of years living in the property before purchase") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -84,10 +64,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You should round up to the nearest year") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb b/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb index d1c1b6884..c4faaea96 100644 --- a/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb +++ b/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MonthlyChargesValueCheck, type: :model do expect(question.id).to eq("monthly_charges_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Monthly charges confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MonthlyChargesValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/monthly_rent_spec.rb b/spec/models/form/sales/questions/monthly_rent_spec.rb index 3c703a7db..c311ca8a4 100644 --- a/spec/models/form/sales/questions/monthly_rent_spec.rb +++ b/spec/models/form/sales/questions/monthly_rent_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MonthlyRent, type: :model do expect(question.id).to eq("mrent") end - it "has the correct header" do - expect(question.header).to eq("What is the basic monthly rent?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Monthly rent") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MonthlyRent, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Amount paid before any charges") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/mortgage_amount_spec.rb b/spec/models/form/sales/questions/mortgage_amount_spec.rb index 148d16506..9d5e68804 100644 --- a/spec/models/form/sales/questions/mortgage_amount_spec.rb +++ b/spec/models/form/sales/questions/mortgage_amount_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do expect(question.id).to eq("mortgage") end - it "has the correct header" do - expect(question.header).to eq("What is the mortgage amount?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Mortgage amount") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do expect(question).not_to be_derived(nil) end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound.") - end - it "has correct width" do expect(question.width).to be(5) end diff --git a/spec/models/form/sales/questions/mortgage_lender_other_spec.rb b/spec/models/form/sales/questions/mortgage_lender_other_spec.rb index e103b0ffd..9701cf19c 100644 --- a/spec/models/form/sales/questions/mortgage_lender_other_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_other_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageLenderOther, type: :model do expect(question.id).to eq("mortgagelenderother") end - it "has the correct header" do - expect(question.header).to eq("What is the other mortgage lender?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Other Mortgage Lender") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -30,8 +22,4 @@ RSpec.describe Form::Sales::Questions::MortgageLenderOther, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end end diff --git a/spec/models/form/sales/questions/mortgage_lender_spec.rb b/spec/models/form/sales/questions/mortgage_lender_spec.rb index d5b2225cc..a7abd4c16 100644 --- a/spec/models/form/sales/questions/mortgage_lender_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do expect(question.id).to eq("mortgagelender") end - it "has the correct header" do - expect(question.header).to eq("What is the name of the mortgage lender?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Mortgage Lender") - end - it "has the correct type" do expect(question.type).to eq("select") end diff --git a/spec/models/form/sales/questions/mortgage_length_spec.rb b/spec/models/form/sales/questions/mortgage_length_spec.rb index 3e6e9b6cf..90c0ccab5 100644 --- a/spec/models/form/sales/questions/mortgage_length_spec.rb +++ b/spec/models/form/sales/questions/mortgage_length_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do expect(question.id).to eq("mortlen") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the mortgage?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of mortgage") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,12 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq( - "You should round up to the nearest year. Value should not exceed 60 years.", - ) - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/mortgage_value_check_spec.rb b/spec/models/form/sales/questions/mortgage_value_check_spec.rb index ec51da724..4ffe96f74 100644 --- a/spec/models/form/sales/questions/mortgage_value_check_spec.rb +++ b/spec/models/form/sales/questions/mortgage_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageValueCheck, type: :model do expect(question.id).to eq("mortgage_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure that the mortgage is more than 5 times the income used for the mortgage application?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Mortgage confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb b/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb index eb89dd910..5f5983831 100644 --- a/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb +++ b/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MultiplePartnersValueCheck, type: :model expect(question.id).to eq("multiple_partners_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Multiple partners confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MultiplePartnersValueCheck, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/nationality_all_group_spec.rb b/spec/models/form/sales/questions/nationality_all_group_spec.rb index 719a5f13e..a88bf1867 100644 --- a/spec/models/form/sales/questions/nationality_all_group_spec.rb +++ b/spec/models/form/sales/questions/nationality_all_group_spec.rb @@ -45,18 +45,6 @@ RSpec.describe Form::Sales::Questions::NationalityAllGroup, type: :model do it "has correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end - - it "has the correct hint" do - expect(question.hint_text).to eq "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." - end - - it "has the correct header" do - expect(question.header).to eq "What is buyer 1’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 1’s nationality" - end end context "with buyer 2" do @@ -73,17 +61,5 @@ RSpec.describe Form::Sales::Questions::NationalityAllGroup, type: :model do it "has correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end - - it "has the correct hint" do - expect(question.hint_text).to eq "If buyer 2 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." - end - - it "has the correct header" do - expect(question.header).to eq "What is buyer 2’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2’s nationality" - end end end diff --git a/spec/models/form/sales/questions/nationality_all_spec.rb b/spec/models/form/sales/questions/nationality_all_spec.rb index 171e9f96d..a83beb51d 100644 --- a/spec/models/form/sales/questions/nationality_all_spec.rb +++ b/spec/models/form/sales/questions/nationality_all_spec.rb @@ -15,18 +15,10 @@ RSpec.describe Form::Sales::Questions::NationalityAll, type: :model do expect(question.id).to eq "some_id" end - it "has the correct header" do - expect(question.header).to eq "Enter a nationality" - end - it "has the correct type" do expect(question.type).to eq "select" end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options.count).to eq(203) end @@ -46,10 +38,6 @@ RSpec.describe Form::Sales::Questions::NationalityAll, type: :model do expect(question.check_answers_card_number).to be 1 end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 1’s nationality" - end - it "has the correct question_number" do expect(question.question_number).to be 24 end @@ -62,10 +50,6 @@ RSpec.describe Form::Sales::Questions::NationalityAll, type: :model do expect(question.check_answers_card_number).to be 2 end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2’s nationality" - end - it "has the correct question_number" do expect(question.question_number).to be 32 end diff --git a/spec/models/form/sales/questions/no_address_found_spec.rb b/spec/models/form/sales/questions/no_address_found_spec.rb index 6d6c2cea5..7dd47a1ee 100644 --- a/spec/models/form/sales/questions/no_address_found_spec.rb +++ b/spec/models/form/sales/questions/no_address_found_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Sales::Questions::NoAddressFound, type: :model do expect(question.id).to eq("address_search_value_check") end - it "has the correct header" do - expect(question.header).to eq("No address found") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -30,10 +22,6 @@ RSpec.describe Form::Sales::Questions::NoAddressFound, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to be_nil end diff --git a/spec/models/form/sales/questions/number_of_others_in_property_spec.rb b/spec/models/form/sales/questions/number_of_others_in_property_spec.rb index 188ad750a..7bf19dbe3 100644 --- a/spec/models/form/sales/questions/number_of_others_in_property_spec.rb +++ b/spec/models/form/sales/questions/number_of_others_in_property_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::NumberOfOthersInProperty, type: :model do expect(question.id).to eq("hholdcount") end - it "has the correct header" do - expect(question.header).to eq("Besides the buyers, how many other people live or will live in the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of other people living in the property") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -32,10 +24,6 @@ RSpec.describe Form::Sales::Questions::NumberOfOthersInProperty, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You can provide details for a maximum of 4 other people for a joint purchase.") - end - it "has the correct min" do expect(question.min).to be 0 end @@ -43,16 +31,4 @@ RSpec.describe Form::Sales::Questions::NumberOfOthersInProperty, type: :model do it "has the correct max" do expect(question.max).to be 15 end - - context "with non joint purchase" do - let(:joint_purchase) { false } - - it "has the correct hint" do - expect(question.hint_text).to eq("You can provide details for a maximum of 5 other people if there is only one buyer.") - end - - it "has the correct header" do - expect(question.header).to eq("Besides the buyer, how many other people live or will live in the property?") - end - end end diff --git a/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb b/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb index 794745c77..3d3eab8a0 100644 --- a/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb +++ b/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck, type expect(question.id).to eq("old_persons_shared_ownership_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Shared ownership confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck, type expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/other_ownership_type_spec.rb b/spec/models/form/sales/questions/other_ownership_type_spec.rb index 0507bf749..bcd52bc59 100644 --- a/spec/models/form/sales/questions/other_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/other_ownership_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::OtherOwnershipType, type: :model do expect(question.id).to eq("othtype") end - it "has the correct header" do - expect(question.header).to eq("What type of sale is it?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of other sale") - end - it "has the correct type" do expect(question.type).to eq("text") end diff --git a/spec/models/form/sales/questions/ownership_scheme_spec.rb b/spec/models/form/sales/questions/ownership_scheme_spec.rb index 93cc4f0b2..99ec32684 100644 --- a/spec/models/form/sales/questions/ownership_scheme_spec.rb +++ b/spec/models/form/sales/questions/ownership_scheme_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do expect(question.id).to eq("ownershipsch") end - it "has the correct header" do - expect(question.header).to eq("Was this purchase made through an ownership scheme?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Purchase made under ownership scheme") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/partner_under16_value_check_spec.rb b/spec/models/form/sales/questions/partner_under16_value_check_spec.rb index 638d49044..0ecd7a2e0 100644 --- a/spec/models/form/sales/questions/partner_under16_value_check_spec.rb +++ b/spec/models/form/sales/questions/partner_under16_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PartnerUnder16ValueCheck, type: :model do expect(question.id).to eq("partner_under_16_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Partner under 16 confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PartnerUnder16ValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb b/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb index 3ec9f96ae..912fd881e 100644 --- a/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb +++ b/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PercentageDiscountValueCheck, type: :mode expect(question.id).to eq("percentage_discount_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage discount confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PercentageDiscountValueCheck, type: :mode expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/person_age_known_spec.rb b/spec/models/form/sales/questions/person_age_known_spec.rb index 66247d075..2f2c12c33 100644 --- a/spec/models/form/sales/questions/person_age_known_spec.rb +++ b/spec/models/form/sales/questions/person_age_known_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - context "with person 2" do let(:question_id) { "age2_known" } let(:person_index) { 2 } @@ -39,14 +35,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age2_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 2’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age2" => [0], @@ -81,14 +69,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age3_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 3’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age3" => [0], @@ -123,14 +103,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age4_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 4’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age4" => [0], @@ -165,14 +137,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age5_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 5’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age5" => [0], diff --git a/spec/models/form/sales/questions/person_age_spec.rb b/spec/models/form/sales/questions/person_age_spec.rb index ff1ff0b2b..5faa046bb 100644 --- a/spec/models/form/sales/questions/person_age_spec.rb +++ b/spec/models/form/sales/questions/person_age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.page).to eq(page) end - it "has the correct header" do - expect(question.header).to eq("Age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -24,10 +20,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct min" do expect(question.min).to eq(0) end @@ -52,10 +44,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age2_known" => 1 }, @@ -76,10 +64,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age3_known" => 1 }, @@ -100,10 +84,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age4") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age4_known" => 1 }, @@ -124,10 +104,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age5") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age5_known" => 1 }, diff --git a/spec/models/form/sales/questions/person_gender_identity_spec.rb b/spec/models/form/sales/questions/person_gender_identity_spec.rb index e38c3c456..32c2a30aa 100644 --- a/spec/models/form/sales/questions/person_gender_identity_spec.rb +++ b/spec/models/form/sales/questions/person_gender_identity_spec.rb @@ -36,26 +36,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do }) end - context "when form year is before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - end - - context "when form year is >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end - context "when person 2" do let(:question_id) { "sex2" } let(:person_index) { 2 } @@ -64,14 +44,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 2’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end @@ -91,14 +63,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex3") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 3’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end @@ -118,14 +82,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex4") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 4’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end @@ -145,14 +101,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex5") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 5’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/person_known_spec.rb b/spec/models/form/sales/questions/person_known_spec.rb index 7668ca7b7..8ef91700e 100644 --- a/spec/models/form/sales/questions/person_known_spec.rb +++ b/spec/models/form/sales/questions/person_known_spec.rb @@ -31,10 +31,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.conditional_for).to be_nil end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to be_nil end @@ -47,14 +43,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_2") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 2?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 2?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end @@ -68,14 +56,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_3") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 3?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 3?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end @@ -89,14 +69,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_4") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 4?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 4?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(4) end @@ -110,14 +82,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_5") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 5?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 5?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb index 821eed3f5..32fb055cd 100644 --- a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb @@ -41,14 +41,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat2") end - it "has the correct header" do - expect(question.header).to eq("What is Person 2’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end @@ -68,14 +60,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat3") end - it "has the correct header" do - expect(question.header).to eq("What is Person 3’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end @@ -95,14 +79,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat4") end - it "has the correct header" do - expect(question.header).to eq("What is Person 4’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end @@ -122,14 +98,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat5") end - it "has the correct header" do - expect(question.header).to eq("What is Person 5’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb b/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb index bc61c464f..007d53d8f 100644 --- a/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb +++ b/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PersonStudentNotChildValueCheck, type: :m expect(question.id).to eq("student_not_child_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this person is not a child?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Student not a child confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PersonStudentNotChildValueCheck, type: :m expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/person_working_situation_spec.rb b/spec/models/form/sales/questions/person_working_situation_spec.rb index 29641dd05..a9f5316cd 100644 --- a/spec/models/form/sales/questions/person_working_situation_spec.rb +++ b/spec/models/form/sales/questions/person_working_situation_spec.rb @@ -49,14 +49,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 2’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end @@ -76,14 +68,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat3") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 3’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end @@ -103,14 +87,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat4") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 4’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end @@ -130,14 +106,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat5") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 5’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb b/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb index 5ba7e8505..dacccefc3 100644 --- a/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb +++ b/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForAddressMatcher, type: :model d expect(question.id).to eq("postcode_full_input") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq(nil) - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -36,10 +28,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForAddressMatcher, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("AA1 1AA") end diff --git a/spec/models/form/sales/questions/postcode_for_full_address_spec.rb b/spec/models/form/sales/questions/postcode_for_full_address_spec.rb index cf4c6c7e6..224141231 100644 --- a/spec/models/form/sales/questions/postcode_for_full_address_spec.rb +++ b/spec/models/form/sales/questions/postcode_for_full_address_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForFullAddress, type: :model do expect(question.id).to eq("postcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Postcode") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForFullAddress, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/postcode_known_spec.rb b/spec/models/form/sales/questions/postcode_known_spec.rb index 2fdbfc670..794c981d4 100644 --- a/spec/models/form/sales/questions/postcode_known_spec.rb +++ b/spec/models/form/sales/questions/postcode_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do expect(question.id).to eq("pcodenk") end - it "has the correct header" do - expect(question.header).to eq("Do you know the property’s postcode?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property’s postcode") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/postcode_spec.rb b/spec/models/form/sales/questions/postcode_spec.rb index b33618d72..480d6af60 100644 --- a/spec/models/form/sales/questions/postcode_spec.rb +++ b/spec/models/form/sales/questions/postcode_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Postcode, type: :model do expect(question.id).to eq("postcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property’s postcode") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Postcode, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/previous_bedrooms_spec.rb b/spec/models/form/sales/questions/previous_bedrooms_spec.rb index 2d1085646..2af0d6f78 100644 --- a/spec/models/form/sales/questions/previous_bedrooms_spec.rb +++ b/spec/models/form/sales/questions/previous_bedrooms_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousBedrooms, type: :model do expect(question.id).to eq("frombeds") end - it "has the correct header" do - expect(question.header).to eq("How many bedrooms did the property have?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of bedrooms in previous property") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PreviousBedrooms, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("For bedsits enter 1") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/previous_la_known_spec.rb b/spec/models/form/sales/questions/previous_la_known_spec.rb index 1a97040fb..d5e536895 100644 --- a/spec/models/form/sales/questions/previous_la_known_spec.rb +++ b/spec/models/form/sales/questions/previous_la_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousLaKnown, type: :model do expect(question.id).to eq("previous_la_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the local authority of buyer 1’s last settled accommodation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Local authority of buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -58,8 +50,4 @@ RSpec.describe Form::Sales::Questions::PreviousLaKnown, type: :model do "prevloc" => [1], }) end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'") - end end diff --git a/spec/models/form/sales/questions/previous_postcode_known_spec.rb b/spec/models/form/sales/questions/previous_postcode_known_spec.rb index bf837acc2..1075b7cd6 100644 --- a/spec/models/form/sales/questions/previous_postcode_known_spec.rb +++ b/spec/models/form/sales/questions/previous_postcode_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcodeKnown, type: :model do expect(question.id).to eq("ppcodenk") end - it "has the correct header" do - expect(question.header).to eq("Do you know the postcode of buyer 1’s last settled accommodation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcodeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'") - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/previous_postcode_spec.rb b/spec/models/form/sales/questions/previous_postcode_spec.rb index 0ddb50c94..10b4c3288 100644 --- a/spec/models/form/sales/questions/previous_postcode_spec.rb +++ b/spec/models/form/sales/questions/previous_postcode_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcode, type: :model do expect(question.id).to eq("ppostcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Postcode of buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcode, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb b/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb index 1779f1ece..08aa51bab 100644 --- a/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb +++ b/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenureBuyer2, type: :model do expect(question.id).to eq("prevtenbuy2") end - it "has the correct header" do - expect(question.header).to eq("What was buyer 2’s previous tenure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s previous tenure") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenureBuyer2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Local authority tenant" }, diff --git a/spec/models/form/sales/questions/previous_tenure_spec.rb b/spec/models/form/sales/questions/previous_tenure_spec.rb index 78b553e14..bd9a0f9ac 100644 --- a/spec/models/form/sales/questions/previous_tenure_spec.rb +++ b/spec/models/form/sales/questions/previous_tenure_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenure, type: :model do expect(question.id).to eq("socprevten") end - it "has the correct header" do - expect(question.header).to eq("What was the previous tenure of the buyer?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Previous property tenure") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenure, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Social Rent" }, diff --git a/spec/models/form/sales/questions/prevloc_spec.rb b/spec/models/form/sales/questions/prevloc_spec.rb index 4db1e3890..d95924810 100644 --- a/spec/models/form/sales/questions/prevloc_spec.rb +++ b/spec/models/form/sales/questions/prevloc_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Sales::Questions::Prevloc, type: :model do expect(question.id).to eq("prevloc") end - it "has the correct header" do - expect(question.header).to eq("Select a local authority") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Local authority of buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("select") end diff --git a/spec/models/form/sales/questions/prevown_spec.rb b/spec/models/form/sales/questions/prevown_spec.rb index 4e5d006d9..0555f32a4 100644 --- a/spec/models/form/sales/questions/prevown_spec.rb +++ b/spec/models/form/sales/questions/prevown_spec.rb @@ -16,28 +16,6 @@ RSpec.describe Form::Sales::Questions::Prevown, type: :model do expect(question.id).to eq("prevown") end - context "when sale is not a joint purchase" do - it "has the correct header" do - expect(question.header).to eq("Has the buyer previously owned a property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer previously owned a property.") - end - end - - context "when sale is a joint purchase" do - let(:joint_purchase) { true } - - it "has the correct header" do - expect(question.header).to eq("Have any of the buyers previously owned a property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyers previously owned a property.") - end - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -57,8 +35,4 @@ RSpec.describe Form::Sales::Questions::Prevown, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end end diff --git a/spec/models/form/sales/questions/prevshared_spec.rb b/spec/models/form/sales/questions/prevshared_spec.rb index 9e6184b02..a668ee1f5 100644 --- a/spec/models/form/sales/questions/prevshared_spec.rb +++ b/spec/models/form/sales/questions/prevshared_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Prevshared, type: :model do expect(question.id).to eq("prevshared") end - it "has the correct header" do - expect(question.header).to eq("Was the previous property under shared ownership?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Previous property shared ownership?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::Prevshared, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("For any buyer") - end end diff --git a/spec/models/form/sales/questions/property_building_type_spec.rb b/spec/models/form/sales/questions/property_building_type_spec.rb index 39048845c..c8a0aecf0 100644 --- a/spec/models/form/sales/questions/property_building_type_spec.rb +++ b/spec/models/form/sales/questions/property_building_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PropertyBuildingType, type: :model do expect(question.id).to eq("builtype") end - it "has the correct header" do - expect(question.header).to eq("What type of building is the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of building") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PropertyBuildingType, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Purpose built" }, diff --git a/spec/models/form/sales/questions/property_local_authority_spec.rb b/spec/models/form/sales/questions/property_local_authority_spec.rb index 4c3b24064..fcdd81d29 100644 --- a/spec/models/form/sales/questions/property_local_authority_spec.rb +++ b/spec/models/form/sales/questions/property_local_authority_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Sales::Questions::PropertyLocalAuthority, type: :model do expect(question.id).to eq("la") end - it "has the correct header" do - expect(question.header).to eq("What is the property’s local authority?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Local authority") - end - it "has the correct type" do expect(question.type).to eq("select") end diff --git a/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb b/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb index 5008b8c50..7887a84ae 100644 --- a/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb +++ b/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do expect(question.id).to eq("beds") end - it "has the correct header" do - expect(question.header).to eq("How many bedrooms does the property have?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of bedrooms") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("A bedsit has 1 bedroom") - end - it "has the correct min" do expect(question.min).to eq(1) end diff --git a/spec/models/form/sales/questions/property_unit_type_spec.rb b/spec/models/form/sales/questions/property_unit_type_spec.rb index 69cb30ad1..c454c7451 100644 --- a/spec/models/form/sales/questions/property_unit_type_spec.rb +++ b/spec/models/form/sales/questions/property_unit_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PropertyUnitType, type: :model do expect(question.id).to eq("proptype") end - it "has the correct header" do - expect(question.header).to eq("What type of unit is the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of unit") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb index 54c27f7bb..6b89deff2 100644 --- a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb @@ -21,14 +21,6 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode expect(question.id).to eq("wchair") end - it "has the correct header" do - expect(question.header).to eq("Is the property built or adapted to wheelchair-user standards?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property built or adapted to wheelchair-user standards") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,14 +36,4 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode "3" => { "value" => "Don't know" }, }) end - - context "with 2024 form" do - before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property.") - end - end end diff --git a/spec/models/form/sales/questions/purchase_price_spec.rb b/spec/models/form/sales/questions/purchase_price_spec.rb index b89bdb284..c3d2999a0 100644 --- a/spec/models/form/sales/questions/purchase_price_spec.rb +++ b/spec/models/form/sales/questions/purchase_price_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do expect(question.id).to eq("value") end - it "has the correct header" do - expect(question.header).to eq("What is the full purchase price?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Purchase price") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,12 +23,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq( - "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount", - ) - end - it "has the correct question_number" do expect(question.question_number).to be_nil end @@ -44,12 +30,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do context "when discounted ownership scheme" do subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 2) } - it "has the correct hint" do - expect(question.hint_text).to eq( - "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount", - ) - end - it "has the correct question_number" do expect(question.question_number).to eq(100) end @@ -58,10 +38,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do context "when outright sale" do subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 3) } - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct question_number" do expect(question.question_number).to eq(110) end diff --git a/spec/models/form/sales/questions/purchaser_code_spec.rb b/spec/models/form/sales/questions/purchaser_code_spec.rb index 8c5eeb081..80295afd5 100644 --- a/spec/models/form/sales/questions/purchaser_code_spec.rb +++ b/spec/models/form/sales/questions/purchaser_code_spec.rb @@ -15,18 +15,6 @@ RSpec.describe Form::Sales::Questions::PurchaserCode, type: :model do expect(question.id).to eq("purchid") end - it "has the correct header" do - expect(question.header).to eq("What is the purchaser code?") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is how you usually refer to the purchaser on your own systems.") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Purchaser code") - end - it "has the correct type" do expect(question.type).to eq("text") end diff --git a/spec/models/form/sales/questions/resale_spec.rb b/spec/models/form/sales/questions/resale_spec.rb index 71e4b82e4..a6583a930 100644 --- a/spec/models/form/sales/questions/resale_spec.rb +++ b/spec/models/form/sales/questions/resale_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Resale, type: :model do expect(question.id).to eq("resale") end - it "has the correct header" do - expect(question.header).to eq("Is this a resale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this a resale?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -41,8 +33,4 @@ RSpec.describe Form::Sales::Questions::Resale, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'.") - end end diff --git a/spec/models/form/sales/questions/retirement_value_check_spec.rb b/spec/models/form/sales/questions/retirement_value_check_spec.rb index af5239011..6af3ed342 100644 --- a/spec/models/form/sales/questions/retirement_value_check_spec.rb +++ b/spec/models/form/sales/questions/retirement_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::RetirementValueCheck, type: :model do expect(question.id).to eq("retirement_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this person is retired?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Retirement confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::RetirementValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/sale_date_check_spec.rb b/spec/models/form/sales/questions/sale_date_check_spec.rb index c3342f04d..211312ba9 100644 --- a/spec/models/form/sales/questions/sale_date_check_spec.rb +++ b/spec/models/form/sales/questions/sale_date_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SaleDateCheck, type: :model do expect(question.id).to eq("saledate_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Sale completion date check") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::SaleDateCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/sale_date_spec.rb b/spec/models/form/sales/questions/sale_date_spec.rb index bbd602aa7..7363b9ddf 100644 --- a/spec/models/form/sales/questions/sale_date_spec.rb +++ b/spec/models/form/sales/questions/sale_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SaleDate, type: :model do expect(question.id).to eq("saledate") end - it "has the correct header" do - expect(question.header).to eq("What is the sale completion date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Sale completion date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/sales/questions/savings_nk_spec.rb b/spec/models/form/sales/questions/savings_nk_spec.rb index 0a8d1a140..597138c2e 100644 --- a/spec/models/form/sales/questions/savings_nk_spec.rb +++ b/spec/models/form/sales/questions/savings_nk_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SavingsNk, type: :model do expect(question.id).to eq("savingsnk") end - it "has the correct header" do - expect(question.header).to eq("Do you know how much the buyer had in savings before they paid any deposit for the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer’s total savings known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::SavingsNk, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq( { diff --git a/spec/models/form/sales/questions/savings_spec.rb b/spec/models/form/sales/questions/savings_spec.rb index 632e5574f..792fd5d29 100644 --- a/spec/models/form/sales/questions/savings_spec.rb +++ b/spec/models/form/sales/questions/savings_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Savings, type: :model do expect(question.id).to eq("savings") end - it "has the correct header" do - expect(question.header).to eq("Enter their total savings to the nearest £10") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer’s total savings before any deposit paid") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Savings, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/savings_value_check_spec.rb b/spec/models/form/sales/questions/savings_value_check_spec.rb index d38d27f03..238df8cef 100644 --- a/spec/models/form/sales/questions/savings_value_check_spec.rb +++ b/spec/models/form/sales/questions/savings_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do expect(question.id).to eq("savings_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure the savings are higher than £100,000?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Savings confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb index e9e86bd42..0c8a37dad 100644 --- a/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipDepositValueCheck, type: : expect(question.id).to eq("shared_ownership_deposit_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Shared ownership deposit confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,14 +23,6 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipDepositValueCheck, type: : expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - - # it "has a correct check_answers_card_number" do - # expect(question.check_answers_card_number).to eq(0) - # end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/staircase_bought_spec.rb b/spec/models/form/sales/questions/staircase_bought_spec.rb index e5cf16a6c..d448e4456 100644 --- a/spec/models/form/sales/questions/staircase_bought_spec.rb +++ b/spec/models/form/sales/questions/staircase_bought_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::StaircaseBought, type: :model do expect(question.id).to eq("stairbought") end - it "has the correct header" do - expect(question.header).to eq("What percentage of the property has been bought in this staircasing transaction?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage bought in this staircasing transaction") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::StaircaseBought, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/staircase_owned_spec.rb b/spec/models/form/sales/questions/staircase_owned_spec.rb index 80cd30543..94d1eac6f 100644 --- a/spec/models/form/sales/questions/staircase_owned_spec.rb +++ b/spec/models/form/sales/questions/staircase_owned_spec.rb @@ -16,28 +16,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwned, type: :model do expect(question.id).to eq("stairowned") end - context "when a joint purchase" do - let(:joint_purchase) { true } - - it "has the correct header" do - expect(question.header).to eq("What percentage of the property do the buyers now own in total?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage the buyers now own in total.") - end - end - - context "when not a joint purchase" do - it "has the correct header" do - expect(question.header).to eq("What percentage of the property does the buyer now own in total?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage the buyer now owns in total.") - end - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -46,10 +24,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwned, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb index 0119e725b..4298e40b8 100644 --- a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb +++ b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwnedValueCheck, type: :model do expect(question.id).to eq("stairowned_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage owned confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwnedValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(nil) end diff --git a/spec/models/form/sales/questions/staircase_sale_spec.rb b/spec/models/form/sales/questions/staircase_sale_spec.rb index f4457811b..d330aecb3 100644 --- a/spec/models/form/sales/questions/staircase_sale_spec.rb +++ b/spec/models/form/sales/questions/staircase_sale_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::StaircaseSale, type: :model do expect(question.id).to eq("staircasesale") end - it "has the correct header" do - expect(question.header).to eq("Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Part of a back-to-back staircasing transaction") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::StaircaseSale, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end end diff --git a/spec/models/form/sales/questions/staircase_spec.rb b/spec/models/form/sales/questions/staircase_spec.rb index a4b176d8a..7b45891da 100644 --- a/spec/models/form/sales/questions/staircase_spec.rb +++ b/spec/models/form/sales/questions/staircase_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Staircase, type: :model do expect(question.id).to eq("staircase") end - it "has the correct header" do - expect(question.header).to eq("Is this a staircasing transaction?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Staircasing transaction") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::Staircase, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property") - end end diff --git a/spec/models/form/sales/questions/town_or_city_spec.rb b/spec/models/form/sales/questions/town_or_city_spec.rb index dfa3ddffc..8516992b6 100644 --- a/spec/models/form/sales/questions/town_or_city_spec.rb +++ b/spec/models/form/sales/questions/town_or_city_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::TownOrCity, type: :model do expect(question.id).to eq("town_or_city") end - it "has the correct header" do - expect(question.header).to eq("Town or city") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Town or city") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::TownOrCity, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb index bb5688944..ddb047937 100644 --- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do expect(question.id).to eq("uprn_confirmed") end - it "has the correct header" do - expect(question.header).to eq("Is this the property address?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this the right address?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must answer is this the right address?") end diff --git a/spec/models/form/sales/questions/uprn_known_spec.rb b/spec/models/form/sales/questions/uprn_known_spec.rb index 9b25defc8..d3a91a3ef 100644 --- a/spec/models/form/sales/questions/uprn_known_spec.rb +++ b/spec/models/form/sales/questions/uprn_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do expect(question.id).to eq("uprn_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -46,14 +38,6 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do expect(question.unanswered_error_message).to eq("You must answer UPRN known?") end - it "has the correct hint" do - expect(question.hint_text).to eq( - "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen.", - ) - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/uprn_selection_spec.rb b/spec/models/form/sales/questions/uprn_selection_spec.rb index cd23a8e9f..ff1b1a6dd 100644 --- a/spec/models/form/sales/questions/uprn_selection_spec.rb +++ b/spec/models/form/sales/questions/uprn_selection_spec.rb @@ -32,14 +32,6 @@ RSpec.describe Form::Sales::Questions::UprnSelection, type: :model do expect(question.id).to eq("uprn_selection") end - it "has the correct header" do - expect(question.header).to eq("Select the correct address") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Select the correct address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -52,10 +44,6 @@ RSpec.describe Form::Sales::Questions::UprnSelection, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer options" do stub_request(:get, /api\.os\.uk/) .to_return(status: 200, body: "", headers: {}) diff --git a/spec/models/form/sales/questions/uprn_spec.rb b/spec/models/form/sales/questions/uprn_spec.rb index 845358bce..9e601dcb9 100644 --- a/spec/models/form/sales/questions/uprn_spec.rb +++ b/spec/models/form/sales/questions/uprn_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do expect(question.id).to eq("uprn") end - it "has the correct header" do - expect(question.header).to eq("What is the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do expect(question.question_number).to eq(14) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("UPRN must be 12 digits or less.") end diff --git a/spec/models/form/sales/questions/value_spec.rb b/spec/models/form/sales/questions/value_spec.rb index ad3d2c4c9..771607c16 100644 --- a/spec/models/form/sales/questions/value_spec.rb +++ b/spec/models/form/sales/questions/value_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Value, type: :model do expect(question.id).to eq("value") end - it "has the correct header" do - expect(question.header).to eq("What was the full purchase price?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Full purchase price") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Value, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)") - end - it "has correct width" do expect(question.width).to eq(5) end From 10e96cc165a8cae40da578bb62b60250f0f57cf8 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 9 Oct 2024 12:29:08 +0100 Subject: [PATCH 15/45] Add tests for copy key and copy to page and question specs --- spec/models/form/page_spec.rb | 37 +++++++++++++++++- spec/models/form/question_spec.rb | 65 ++++++++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 4 deletions(-) diff --git a/spec/models/form/page_spec.rb b/spec/models/form/page_spec.rb index c66c0eca8..1ca01875a 100644 --- a/spec/models/form/page_spec.rb +++ b/spec/models/form/page_spec.rb @@ -8,8 +8,8 @@ RSpec.describe Form::Page, type: :model do let(:depends_on) { nil } let(:enabled) { true } let(:depends_on_met) { true } - let(:form) { instance_double(Form, depends_on_met:) } - let(:subsection) { instance_double(Form::Subsection, depends_on:, enabled?: enabled, form:) } + let(:form) { instance_double(Form, depends_on_met:, type: "form-type") } + let(:subsection) { instance_double(Form::Subsection, depends_on:, enabled?: enabled, form:, id: "subsection-id") } let(:page_id) { "net_income" } let(:questions) { [["earnings", { "conditional_for" => { "age1": nil }, "type" => "radio" }], %w[incfreq]] } let(:page_definition) do @@ -24,6 +24,39 @@ RSpec.describe Form::Page, type: :model do expect(page.id).to eq(page_id) end + it "sets copy_key in the default style" do + expect(page.copy_key).to eq("#{form.type}.#{subsection.id}.#{questions[0].id}") + end + + context "when header is not provided" do + let(:page_definition) do + { + "questions" => questions, + } + end + + context "and translation is present" do + before do + allow(I18n).to receive(:t).and_return("page header copy") + allow(I18n).to receive(:exists?).and_return(true) + end + + it "uses header from translations" do + expect(page.header).to eq("page header copy") + end + end + + context "and translation is not present" do + before do + allow(I18n).to receive(:exists?).and_return(false) + end + + it "uses empty header" do + expect(page.header).to eq("") + end + end + end + it "has a header" do expect(page.header).to eq("Test header") end diff --git a/spec/models/form/question_spec.rb b/spec/models/form/question_spec.rb index ca67e1103..d059edf59 100644 --- a/spec/models/form/question_spec.rb +++ b/spec/models/form/question_spec.rb @@ -14,8 +14,8 @@ RSpec.describe Form::Question, type: :model do let(:answer_options) { { "1" => { "value" => "Weekly" }, "2" => { "value" => "Monthly" } } } let(:inferred_check_answers_value) { [{ "condition" => { "postcode_known" => 0 }, "value" => "Weekly" }] } - let(:form) { instance_double(Form, depends_on_met:, conditional_question_conditions:) } - let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, depends_on_met:, conditional_question_conditions:, type: "form-type", start_date: Time.utc(2024, 12, 25)) } + let(:subsection) { instance_double(Form::Subsection, form:, id: "subsection-id") } let(:page) { instance_double(Form::Page, subsection:, routed_to?: true, questions: form_questions) } let(:question_id) { "earnings" } let(:question_definition) do @@ -38,6 +38,67 @@ RSpec.describe Form::Question, type: :model do expect(question.id).to eq(question_id) end + it "sets copy_key in the default style" do + expect(question.copy_key).to eq("#{form.type}.#{subsection.id}.#{question_id}") + end + + context "when copy is not provided" do + let(:question_definition) do + { + "type" => type, + "min" => 0, + "step" => 1, + "answer_options" => answer_options, + "readonly" => readonly, + "result-field" => "tcharge", + "fields-to-add" => %w[brent scharge pscharge supcharg], + "inferred_check_answers_value" => inferred_check_answers_value, + "suffix" => suffix, + "prefix" => prefix, + "hidden_in_check_answers" => {} + } + end + + context "and translations are present" do + before do + allow(I18n).to receive(:t).with("forms.#{form.start_date.year}.#{question.copy_key}.question_text", { default: "" }).and_return("header copy") + allow(I18n).to receive(:t).with("forms.#{form.start_date.year}.#{question.copy_key}.check_answer_label", { default: "" }).and_return("check answer label copy") + allow(I18n).to receive(:t).with("forms.#{form.start_date.year}.#{question.copy_key}.hint_text", { default: "" }).and_return("hint text copy") + allow(I18n).to receive(:exists?).and_return(true) + end + + it "uses header from translations" do + expect(question.header).to eq("header copy") + end + + it "uses check answer label from translations" do + expect(question.check_answer_label).to eq("check answer label copy") + end + + it "uses hint text from translations" do + expect(question.hint_text).to eq("hint text copy") + end + end + + context "and translations are not present" do + before do + allow(I18n).to receive(:exists?).and_return(false) + end + + it "uses empty header" do + expect(question.header).to eq("") + end + + it "uses empty check answer label" do + expect(question.check_answer_label).to eq("") + end + + it "uses empty hint text" do + expect(question.hint_text).to eq("") + end + end + end + it "has a header" do expect(question.header).to eq("What is the tenant’s /and partner’s combined income after tax?") end From 9a4f2bc52d42d9915f50e1ba2e9d0ae3c40e6181 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 9 Oct 2024 13:50:16 +0100 Subject: [PATCH 16/45] Add tests where there is logic on page/question to decide copy key --- .../form/sales/pages/buyer_interview_spec.rb | 16 ++++++++++++++ .../form/sales/pages/privacy_notice_spec.rb | 22 ++++++++++++------- .../sales/questions/buyer_interview_spec.rb | 16 ++++++++++++++ .../sales/questions/privacy_notice_spec.rb | 16 ++++++++++++++ 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb index 9065c3e57..ce72974e9 100644 --- a/spec/models/form/sales/pages/buyer_interview_spec.rb +++ b/spec/models/form/sales/pages/buyer_interview_spec.rb @@ -22,4 +22,20 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do it "has the correct description" do expect(page.description).to be_nil end + + context "when there are joint buyers" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.noint.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase") + end + end end diff --git a/spec/models/form/sales/pages/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb index 774b7f3b9..1d146f0af 100644 --- a/spec/models/form/sales/pages/privacy_notice_spec.rb +++ b/spec/models/form/sales/pages/privacy_notice_spec.rb @@ -29,21 +29,27 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do expect(page.description).to be_nil end - it "has correct depends_on" do - expect(page.depends_on).to eq([{ "not_joint_purchase?" => true }, { "jointpur" => nil }]) - end - - context "with joint purchase" do + context "when there are joint buyers" do subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } - let(:page_id) { "privacy_notice_joint_purchase" } + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + end it "has correct depends_on" do expect(page.depends_on).to eq([{ "joint_purchase?" => true }]) end + end + + context "when there is a single buyer" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + end - it "has the correct id" do - expect(page.id).to eq("privacy_notice_joint_purchase") + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "not_joint_purchase?" => true }, { "jointpur" => nil }]) end end end diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb index df5dcd0be..3370a84f5 100644 --- a/spec/models/form/sales/questions/buyer_interview_spec.rb +++ b/spec/models/form/sales/questions/buyer_interview_spec.rb @@ -29,4 +29,20 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do "1" => { "value" => "No" }, }) end + + context "when there are joint buyers" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") + end + end end diff --git a/spec/models/form/sales/questions/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb index b862c9ff0..11589049d 100644 --- a/spec/models/form/sales/questions/privacy_notice_spec.rb +++ b/spec/models/form/sales/questions/privacy_notice_spec.rb @@ -31,6 +31,22 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do expect(question.derived?(nil)).to be false end + context "when there are joint buyers" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + end + end + context "when the form year is before 2024" do before do allow(form).to receive(:start_year_after_2024?).and_return(false) From 0cb0add7a73384ebd65c8996d66f3564bf8a73dd Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 9 Oct 2024 15:10:25 +0100 Subject: [PATCH 17/45] Fix lint --- spec/models/form/question_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/form/question_spec.rb b/spec/models/form/question_spec.rb index d059edf59..6f6aa9e02 100644 --- a/spec/models/form/question_spec.rb +++ b/spec/models/form/question_spec.rb @@ -55,7 +55,7 @@ RSpec.describe Form::Question, type: :model do "inferred_check_answers_value" => inferred_check_answers_value, "suffix" => suffix, "prefix" => prefix, - "hidden_in_check_answers" => {} + "hidden_in_check_answers" => {}, } end From 2dd204d0beb09383f688dc0b4532e558e36bd85d Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 9 Oct 2024 15:17:29 +0100 Subject: [PATCH 18/45] Fix tests --- spec/models/form/page_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/form/page_spec.rb b/spec/models/form/page_spec.rb index 1ca01875a..9315fb237 100644 --- a/spec/models/form/page_spec.rb +++ b/spec/models/form/page_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Page, type: :model do let(:depends_on) { nil } let(:enabled) { true } let(:depends_on_met) { true } - let(:form) { instance_double(Form, depends_on_met:, type: "form-type") } + let(:form) { instance_double(Form, depends_on_met:, type: "form-type", start_date: Time.utc(2024, 12, 25)) } let(:subsection) { instance_double(Form::Subsection, depends_on:, enabled?: enabled, form:, id: "subsection-id") } let(:page_id) { "net_income" } let(:questions) { [["earnings", { "conditional_for" => { "age1": nil }, "type" => "radio" }], %w[incfreq]] } @@ -25,7 +25,7 @@ RSpec.describe Form::Page, type: :model do end it "sets copy_key in the default style" do - expect(page.copy_key).to eq("#{form.type}.#{subsection.id}.#{questions[0].id}") + expect(page.copy_key).to eq("#{form.type}.#{subsection.id}.#{questions[0][0]}") end context "when header is not provided" do From f75c5f3ba2b59b4625cad92d55cfa7b825c94d3f Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:32:59 +0100 Subject: [PATCH 19/45] Move question details to translation files --- .../sales/pages/property_local_authority.rb | 2 +- .../questions/about_price_value_check.rb | 3 +- .../form/sales/questions/address_line1.rb | 3 +- .../address_line1_for_address_matcher.rb | 3 +- .../form/sales/questions/address_line2.rb | 2 +- .../questions/buyer1_income_value_check.rb | 3 +- .../questions/buyer2_income_value_check.rb | 3 +- .../questions/combined_income_value_check.rb | 3 +- app/models/form/sales/questions/county.rb | 3 +- .../questions/monthly_charges_value_check.rb | 3 +- .../form/sales/questions/no_address_found.rb | 2 +- .../questions/postcode_for_address_matcher.rb | 2 +- .../questions/postcode_for_full_address.rb | 3 +- .../sales/questions/property_building_type.rb | 3 +- .../questions/property_local_authority.rb | 3 +- .../questions/property_number_of_bedrooms.rb | 4 +- .../sales/questions/property_unit_type.rb | 3 +- .../property_wheelchair_accessible.rb | 3 +- .../form/sales/questions/town_or_city.rb | 3 +- app/models/form/sales/questions/uprn.rb | 3 +- .../form/sales/questions/uprn_confirmation.rb | 3 +- app/models/form/sales/questions/uprn_known.rb | 6 +- .../form/sales/questions/uprn_selection.rb | 3 +- .../sales/subsections/property_information.rb | 4 +- .../locales/forms/2023/sales/property.en.yml | 117 +++++++++++++++ .../locales/forms/2024/sales/property.en.yml | 142 ++++++++++++++++++ 26 files changed, 284 insertions(+), 48 deletions(-) create mode 100644 config/locales/forms/2023/sales/property.en.yml create mode 100644 config/locales/forms/2024/sales/property.en.yml diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb index e0289839d..30d96bef4 100644 --- a/app/models/form/sales/pages/property_local_authority.rb +++ b/app/models/form/sales/pages/property_local_authority.rb @@ -15,7 +15,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page ].compact end - def la_known_question + def la_known_question #TODO: Pre 2023, could be removed? Only used here. if form.start_date.year < 2023 Form::Sales::Questions::PropertyLocalAuthorityKnown.new(nil, nil, self) end diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb index 2b51cd7fb..a09bf25d4 100644 --- a/app/models/form/sales/questions/about_price_value_check.rb +++ b/app/models/form/sales/questions/about_price_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "value_value_check" - @check_answer_label = "Purchase price confirmation" - @header = "Are you sure?" + @copy_key = "sales.property.value_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/address_line1.rb b/app/models/form/sales/questions/address_line1.rb index f72aaea96..217e0c69b 100644 --- a/app/models/form/sales/questions/address_line1.rb +++ b/app/models/form/sales/questions/address_line1.rb @@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question def initialize(id, hsh, page) super @id = "address_line1" - @header = "Address line 1" + @copy_key = "sales.property.address.address_line1" @error_label = "Address line 1" @type = "text" @plain_label = true - @check_answer_label = "Address lines 1 and 2" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/address_line1_for_address_matcher.rb b/app/models/form/sales/questions/address_line1_for_address_matcher.rb index fd1211b69..c23b8cab3 100644 --- a/app/models/form/sales/questions/address_line1_for_address_matcher.rb +++ b/app/models/form/sales/questions/address_line1_for_address_matcher.rb @@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1ForAddressMatcher < ::Form::Question def initialize(id, hsh, page) super @id = "address_line1_input" - @header = "Address line 1" + @copy_key = "sales.property.address_matcher.address_line1_input" @error_label = "Address line 1" @type = "text" @plain_label = true - @check_answer_label = "Find address" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @hide_question_number_on_page = true end diff --git a/app/models/form/sales/questions/address_line2.rb b/app/models/form/sales/questions/address_line2.rb index 94396a2af..4a1cc643b 100644 --- a/app/models/form/sales/questions/address_line2.rb +++ b/app/models/form/sales/questions/address_line2.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::AddressLine2 < ::Form::Question def initialize(id, hsh, page) super @id = "address_line2" - @header = "Address line 2 (optional)" + @copy_key = "sales.property.address.address_line2" @type = "text" @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true diff --git a/app/models/form/sales/questions/buyer1_income_value_check.rb b/app/models/form/sales/questions/buyer1_income_value_check.rb index 63e3b6478..136cd2112 100644 --- a/app/models/form/sales/questions/buyer1_income_value_check.rb +++ b/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:) super(id, hsh, page) @id = "income1_value_check" - @check_answer_label = "Buyer 1 income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.property.income1_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/buyer2_income_value_check.rb b/app/models/form/sales/questions/buyer2_income_value_check.rb index 37b6cb380..bebdc1433 100644 --- a/app/models/form/sales/questions/buyer2_income_value_check.rb +++ b/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:) super(id, hsh, page) @id = "income2_value_check" - @check_answer_label = "Buyer 2 income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "soft_validations.income2_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/combined_income_value_check.rb b/app/models/form/sales/questions/combined_income_value_check.rb index 47cafeaa2..01377512f 100644 --- a/app/models/form/sales/questions/combined_income_value_check.rb +++ b/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:) super(id, hsh, page) @id = "combined_income_value_check" - @check_answer_label = "Combined income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.property.combined_income_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/county.rb b/app/models/form/sales/questions/county.rb index d95d90e73..d9e0d14ae 100644 --- a/app/models/form/sales/questions/county.rb +++ b/app/models/form/sales/questions/county.rb @@ -2,10 +2,9 @@ class Form::Sales::Questions::County < ::Form::Question def initialize(id, hsh, page) super @id = "county" - @header = "County (optional)" + @copy_key = "sales.property.address.county" @type = "text" @plain_label = true - @check_answer_label = "County" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb index 90fcf4545..71abc1888 100644 --- a/app/models/form/sales/questions/monthly_charges_value_check.rb +++ b/app/models/form/sales/questions/monthly_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "monthly_charges_value_check" - @check_answer_label = "Monthly charges confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.property.monthly_charges_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/no_address_found.rb b/app/models/form/sales/questions/no_address_found.rb index 0db041111..c623c3da5 100644 --- a/app/models/form/sales/questions/no_address_found.rb +++ b/app/models/form/sales/questions/no_address_found.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::NoAddressFound < ::Form::Question def initialize(id, hsh, page) super @id = "address_search_value_check" - @header = "No address found" + @copy_key = "sales.property.address_search_value_check" @type = "interruption_screen" @hidden_in_check_answers = true end diff --git a/app/models/form/sales/questions/postcode_for_address_matcher.rb b/app/models/form/sales/questions/postcode_for_address_matcher.rb index 421cdc4fc..d520538b2 100644 --- a/app/models/form/sales/questions/postcode_for_address_matcher.rb +++ b/app/models/form/sales/questions/postcode_for_address_matcher.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForAddressMatcher < ::Form::Question def initialize(id, hsh, page) super @id = "postcode_full_input" - @header = "Postcode" + @copy_key = "sales.property.address_matcher.postcode_full_input" @type = "text" @width = 5 @plain_label = true diff --git a/app/models/form/sales/questions/postcode_for_full_address.rb b/app/models/form/sales/questions/postcode_for_full_address.rb index 74c235ab7..c6ed883a0 100644 --- a/app/models/form/sales/questions/postcode_for_full_address.rb +++ b/app/models/form/sales/questions/postcode_for_full_address.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question def initialize(id, hsh, page) super @id = "postcode_full" - @header = "Postcode" + @copy_key = "sales.property.address.postcode_full" @type = "text" @width = 5 @inferred_check_answers_value = [{ @@ -17,7 +17,6 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question }, } @plain_label = true - @check_answer_label = "Postcode" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/property_building_type.rb b/app/models/form/sales/questions/property_building_type.rb index f8f7e3905..036864be3 100644 --- a/app/models/form/sales/questions/property_building_type.rb +++ b/app/models/form/sales/questions/property_building_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question def initialize(id, hsh, page) super @id = "builtype" - @check_answer_label = "Type of building" - @header = "What type of building is the property?" + @copy_key = "sales.property.builtype" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/property_local_authority.rb b/app/models/form/sales/questions/property_local_authority.rb index 2a8d3cc69..3b7c55651 100644 --- a/app/models/form/sales/questions/property_local_authority.rb +++ b/app/models/form/sales/questions/property_local_authority.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question def initialize(id, hsh, page) super @id = "la" - @check_answer_label = "Local authority" - @header = "What is the property’s local authority?" + @copy_key = "sales.property.la" @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @disable_clearing_if_not_routed_or_dynamic_answer_options = true diff --git a/app/models/form/sales/questions/property_number_of_bedrooms.rb b/app/models/form/sales/questions/property_number_of_bedrooms.rb index b8462b6fa..e3cf38fec 100644 --- a/app/models/form/sales/questions/property_number_of_bedrooms.rb +++ b/app/models/form/sales/questions/property_number_of_bedrooms.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question def initialize(id, hsh, page) super @id = "beds" - @check_answer_label = "Number of bedrooms" - @header = "How many bedrooms does the property have?" - @hint_text = "A bedsit has 1 bedroom" + @copy_key = "sales.property.beds" @type = "numeric" @width = 2 @min = 1 diff --git a/app/models/form/sales/questions/property_unit_type.rb b/app/models/form/sales/questions/property_unit_type.rb index 1622473ec..55fb34315 100644 --- a/app/models/form/sales/questions/property_unit_type.rb +++ b/app/models/form/sales/questions/property_unit_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question def initialize(id, hsh, page) super @id = "proptype" - @check_answer_label = "Type of unit" - @header = "What type of unit is the property?" + @copy_key = "sales.property.proptype" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/property_wheelchair_accessible.rb b/app/models/form/sales/questions/property_wheelchair_accessible.rb index 1569725c5..b418d9bd7 100644 --- a/app/models/form/sales/questions/property_wheelchair_accessible.rb +++ b/app/models/form/sales/questions/property_wheelchair_accessible.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question def initialize(id, hsh, page) super @id = "wchair" - @check_answer_label = "Property built or adapted to wheelchair-user standards" - @header = "Is the property built or adapted to wheelchair-user standards?" + @copy_key = "sales.property.wchair" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/town_or_city.rb b/app/models/form/sales/questions/town_or_city.rb index 18f6298f3..fd3ebe5e8 100644 --- a/app/models/form/sales/questions/town_or_city.rb +++ b/app/models/form/sales/questions/town_or_city.rb @@ -2,10 +2,9 @@ class Form::Sales::Questions::TownOrCity < ::Form::Question def initialize(id, hsh, page) super @id = "town_or_city" - @header = "Town or city" + @copy_key = "sales.property.address.town_or_city" @type = "text" @plain_label = true - @check_answer_label = "Town or city" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/uprn.rb b/app/models/form/sales/questions/uprn.rb index 75a41a0ec..25daf66b7 100644 --- a/app/models/form/sales/questions/uprn.rb +++ b/app/models/form/sales/questions/uprn.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Uprn < ::Form::Question def initialize(id, hsh, page) super @id = "uprn" - @check_answer_label = "UPRN" - @header = "What is the property's UPRN?" + @copy_key = "sales.property.uprn" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb index 6954a6ea5..467e50109 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -2,9 +2,8 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_confirmed" - @header = "Is this the property address?" @type = "radio" - @check_answer_label = "Is this the right address?" + @copy_key = "sales.property.uprn_confirmed" end def answer_options diff --git a/app/models/form/sales/questions/uprn_known.rb b/app/models/form/sales/questions/uprn_known.rb index 44ce03cad..5ddcdc324 100644 --- a/app/models/form/sales/questions/uprn_known.rb +++ b/app/models/form/sales/questions/uprn_known.rb @@ -2,13 +2,9 @@ class Form::Sales::Questions::UprnKnown < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_known" - @check_answer_label = "UPRN known?" - @header = "Do you know the property's UPRN?" + @copy_key = "sales.property.uprn_known" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." @conditional_for = { "uprn" => [1] } @inferred_check_answers_value = [ { diff --git a/app/models/form/sales/questions/uprn_selection.rb b/app/models/form/sales/questions/uprn_selection.rb index f916dcd47..6b512f869 100644 --- a/app/models/form/sales/questions/uprn_selection.rb +++ b/app/models/form/sales/questions/uprn_selection.rb @@ -2,9 +2,8 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_selection" - @header = "Select the correct address" + @copy_key = "sales.property.uprn_selection" @type = "radio" - @check_answer_label = "Select the correct address" @disable_clearing_if_not_routed_or_dynamic_answer_options = true end diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index 2c530ab60..43bf4e9e7 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -16,7 +16,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self), Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self), (uprn_questions if form.start_date.year == 2023), - (postcode_and_la_questions if form.start_date.year < 2023), + (postcode_and_la_questions if form.start_date.year < 2023), #TODO: Pre 2023, could be removed? Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self), ].flatten.compact end @@ -50,7 +50,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection end end - def postcode_and_la_questions + def postcode_and_la_questions #TODO: Pre 2023, could be removed? [ Form::Sales::Pages::Postcode.new(nil, nil, self), Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self), diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml new file mode 100644 index 000000000..4b9050153 --- /dev/null +++ b/config/locales/forms/2023/sales/property.en.yml @@ -0,0 +1,117 @@ +en: + forms: + 2023: + sales: + property: + uprn: + page_header: "What is the property's UPRN?" + check_answer_label: "UPRN" + hint_text: "" + question_text: "" + + uprn_known: + page_header: "Do you know the property's UPRN?" + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

+ The UPRN may not be the same as the property reference assigned by your organisation.

+ If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "" + + uprn_confirmed: + page_header: "Is this the property address?" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "" + + address: + address_line1: + page_header: "Address line 1" + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "" + address_line2: + page_header: "Address line 2 (optional)" + check_answer_label: "" + hint_text: "" + question_text: "" + town_or_city: + page_header: "Town or city" + check_answer_label: "Town or city" + hint_text: "" + question_text: "" + county: + page_header: "County (optional)" + check_answer_label: "County" + hint_text: "" + question_text: "" + postcode_full: + page_header: "Postcode" + check_answer_label: "Postcode" + hint_text: "" + question_text: "" + + la: + page_header: "What is the property’s local authority?" + check_answer_label: "Local authority" + hint_text: "" + question_text: "" + + income1_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Buyer 1 income confirmation" + hint_text: "" + question_text: "" + + income2_value_check": + page_header: "Are you sure this is correct?" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "" + + combined_income_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "" + + value_value_check: + page_header: "Are you sure?" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "" + + beds: + page_header: "How many bedrooms does the property have?" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "" + + proptype: + page_header: "What type of unit is the property?" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "" + + monthly_charges_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "" + + percentage_discount_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "" + + builtype: + page_header: "What type of building is the property?" + check_answer_label: "Type of building" + hint_text: "" + question_text: "" + + wchair: + page_header: "Is the property built or adapted to wheelchair-user standards?" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "" + question_text: "" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml new file mode 100644 index 000000000..0539ca4a9 --- /dev/null +++ b/config/locales/forms/2024/sales/property.en.yml @@ -0,0 +1,142 @@ +en: + forms: + 2024: + sales: + property: + uprn: + page_header: "What is the property's UPRN?" + check_answer_label: "UPRN" + hint_text: "" + question_text: "" + + uprn_known: + page_header: "Do you know the property's UPRN?" + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

+ The UPRN may not be the same as the property reference assigned by your organisation.

+ If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "" + + uprn_confirmed: + page_header: "Is this the property address?" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "" + + address_matcher: + address_line1_input: + page_header: "Address line 1" + check_answer_label: "Find address" + hint_text: "" + question_text: "" + postcode_full_input: + page_header: "Postcode" + check_answer_label: "" + hint_text: "" + question_text: "" + + address_search_value_check: + page_header: "No address found" + check_answer_label: "" + hint_text: "" + question_text: "" + + uprn_selection: + page_header: "Select the correct address" + check_answer_label: "Select the correct address" + hint_text: "" + question_text: "" + + address: + address_line1: + page_header: "Address line 1" + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "" + address_line2: + page_header: "Address line 2 (optional)" + check_answer_label: "" + hint_text: "" + question_text: "" + town_or_city: + page_header: "Town or city" + check_answer_label: "Town or city" + hint_text: "" + question_text: "" + county: + page_header: "County (optional)" + check_answer_label: "County" + hint_text: "" + question_text: "" + postcode_full: + page_header: "Postcode" + check_answer_label: "Postcode" + hint_text: "" + question_text: "" + + la: + page_header: "What is the property’s local authority?" + check_answer_label: "Local authority" + hint_text: "" + question_text: "" + + income1_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Buyer 1 income confirmation" + hint_text: "" + question_text: "" + + income2_value_check": + page_header: "Are you sure this is correct?" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "" + + combined_income_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "" + + value_value_check: + page_header: "Are you sure?" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "" + + beds: + page_header: "How many bedrooms does the property have?" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "" + + proptype: + page_header: "What type of unit is the property?" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "" + + monthly_charges_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "" + + percentage_discount_value_check: + page_header: "Are you sure this is correct?" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "" + + builtype: + page_header: "What type of building is the property?" + check_answer_label: "Type of building" + hint_text: "" + question_text: "" + + wchair: + page_header: "Is the property built or adapted to wheelchair-user standards?" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "" + question_text: "" + From 898768019b9f7e8e127ed85c16c482ed1e3d581a Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:56:22 +0100 Subject: [PATCH 20/45] Add page headers --- app/models/form/sales/pages/address.rb | 2 +- .../form/sales/pages/address_fallback.rb | 2 +- .../form/sales/pages/address_matcher.rb | 2 +- .../form/sales/pages/uprn_confirmation.rb | 2 +- app/models/form/sales/pages/uprn_selection.rb | 2 +- .../locales/forms/2023/sales/property.en.yml | 72 +++++++-------- .../locales/forms/2024/sales/property.en.yml | 88 +++++++++---------- 7 files changed, 80 insertions(+), 90 deletions(-) diff --git a/app/models/form/sales/pages/address.rb b/app/models/form/sales/pages/address.rb index 6bd74f8b7..6c83aabdc 100644 --- a/app/models/form/sales/pages/address.rb +++ b/app/models/form/sales/pages/address.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::Address < ::Form::Page def initialize(id, hsh, subsection) super @id = "address" - @header = "Q#{QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]} - What is the property's address?" + @copy_key = "sales.property.address" @depends_on = [ { "uprn_known" => nil }, { "uprn_known" => 0 }, diff --git a/app/models/form/sales/pages/address_fallback.rb b/app/models/form/sales/pages/address_fallback.rb index 3a69dabba..449dc5a40 100644 --- a/app/models/form/sales/pages/address_fallback.rb +++ b/app/models/form/sales/pages/address_fallback.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressFallback < ::Form::Page def initialize(id, hsh, subsection) super @id = "address" - @header = "Q12 - What is the property's address?" + @copy_key = "sales.property.address" @depends_on = [ { "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" }, { "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" }, diff --git a/app/models/form/sales/pages/address_matcher.rb b/app/models/form/sales/pages/address_matcher.rb index 5d2a38767..5384ec4c1 100644 --- a/app/models/form/sales/pages/address_matcher.rb +++ b/app/models/form/sales/pages/address_matcher.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressMatcher < ::Form::Page def initialize(id, hsh, subsection) super @id = "address_matcher" - @header = "Find an address" + @header = "sales.property.address_matcher" @depends_on = [ { "uprn_known" => nil }, { "uprn_known" => 0 }, diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb index d553972a3..c7e6858df 100644 --- a/app/models/form/sales/pages/uprn_confirmation.rb +++ b/app/models/form/sales/pages/uprn_confirmation.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_confirmation" - @header = "We found an address that might be this property" + @copy_key = "sales.property.uprn_confirmed" end def questions diff --git a/app/models/form/sales/pages/uprn_selection.rb b/app/models/form/sales/pages/uprn_selection.rb index 94f35540f..b6188ec30 100644 --- a/app/models/form/sales/pages/uprn_selection.rb +++ b/app/models/form/sales/pages/uprn_selection.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::UprnSelection < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_selection" - @header = "We found some addresses that might be this property" + @copy_key = "sales.property.uprn_selection" @depends_on = [ { "uprn_known" => nil, "address_options_present?" => true }, { "uprn_known" => 0, "address_options_present?" => true }, diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index 4b9050153..c92abe9cf 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -4,114 +4,110 @@ en: sales: property: uprn: - page_header: "What is the property's UPRN?" + page_header: "" check_answer_label: "UPRN" hint_text: "" - question_text: "" + question_text: "What is the property's UPRN?" uprn_known: - page_header: "Do you know the property's UPRN?" + page_header: "" check_answer_label: "UPRN known?" hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." - question_text: "" + question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "Is this the property address?" + page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" - question_text: "" + question_text: "Is this the property address?" address: + page_header: "Q15 - What is the property's address?" address_line1: - page_header: "Address line 1" check_answer_label: "Address lines 1 and 2" hint_text: "" - question_text: "" + question_text: "Address line 1" address_line2: - page_header: "Address line 2 (optional)" check_answer_label: "" hint_text: "" - question_text: "" + question_text: "Address line 2 (optional)" town_or_city: - page_header: "Town or city" check_answer_label: "Town or city" hint_text: "" - question_text: "" + question_text: "Town or city" county: - page_header: "County (optional)" check_answer_label: "County" hint_text: "" - question_text: "" + question_text: "County (optional)" postcode_full: - page_header: "Postcode" check_answer_label: "Postcode" hint_text: "" - question_text: "" + question_text: "Postcode" la: - page_header: "What is the property’s local authority?" + page_header: "" check_answer_label: "Local authority" hint_text: "" - question_text: "" + question_text: "What is the property’s local authority?" income1_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Buyer 1 income confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" income2_value_check": - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Buyer 2 income confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" combined_income_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Combined income confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" value_value_check: - page_header: "Are you sure?" + page_header: "" check_answer_label: "Purchase price confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure?" beds: - page_header: "How many bedrooms does the property have?" + page_header: "" check_answer_label: "Number of bedrooms" hint_text: "A bedsit has 1 bedroom." - question_text: "" + question_text: "How many bedrooms does the property have?" proptype: - page_header: "What type of unit is the property?" + page_header: "" check_answer_label: "Type of unit" hint_text: "" - question_text: "" + question_text: "What type of unit is the property?" monthly_charges_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Monthly charges confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" percentage_discount_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Percentage discount confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" builtype: - page_header: "What type of building is the property?" + page_header: "" check_answer_label: "Type of building" hint_text: "" - question_text: "" + question_text: "What type of building is the property?" wchair: - page_header: "Is the property built or adapted to wheelchair-user standards?" + page_header: "" check_answer_label: "Property built or adapted to wheelchair-user standards" hint_text: "" - question_text: "" + question_text: "Is the property built or adapted to wheelchair-user standards?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 0539ca4a9..61eaeb5bb 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -4,139 +4,133 @@ en: sales: property: uprn: - page_header: "What is the property's UPRN?" + page_header: "" check_answer_label: "UPRN" hint_text: "" - question_text: "" + question_text: "What is the property's UPRN?" uprn_known: - page_header: "Do you know the property's UPRN?" + page_header: "" check_answer_label: "UPRN known?" hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." - question_text: "" + question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "Is this the property address?" + page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" - question_text: "" + question_text: "Is this the property address?" address_matcher: + page_header: "Find an address" address_line1_input: - page_header: "Address line 1" check_answer_label: "Find address" hint_text: "" - question_text: "" + question_text: "Address line 1" postcode_full_input: - page_header: "Postcode" check_answer_label: "" hint_text: "" - question_text: "" + question_text: "Postcode" address_search_value_check: - page_header: "No address found" + page_header: "" check_answer_label: "" hint_text: "" - question_text: "" + question_text: "No address found" uprn_selection: - page_header: "Select the correct address" + page_header: "We found some addresses that might be this property" check_answer_label: "Select the correct address" hint_text: "" - question_text: "" + question_text: "Select the correct address" address: + page_header: "Q12 - What is the property's address?" address_line1: - page_header: "Address line 1" check_answer_label: "Address lines 1 and 2" hint_text: "" - question_text: "" + question_text: "Address line 1" address_line2: - page_header: "Address line 2 (optional)" check_answer_label: "" hint_text: "" - question_text: "" + question_text: "Address line 2 (optional)" town_or_city: - page_header: "Town or city" check_answer_label: "Town or city" hint_text: "" - question_text: "" + question_text: "Town or city" county: - page_header: "County (optional)" check_answer_label: "County" hint_text: "" - question_text: "" + question_text: "County (optional)" postcode_full: - page_header: "Postcode" check_answer_label: "Postcode" hint_text: "" - question_text: "" + question_text: "Postcode" la: - page_header: "What is the property’s local authority?" + page_header: "" check_answer_label: "Local authority" hint_text: "" - question_text: "" + question_text: "What is the property’s local authority?" income1_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Buyer 1 income confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" income2_value_check": - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Buyer 2 income confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" combined_income_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Combined income confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" value_value_check: - page_header: "Are you sure?" + page_header: "" check_answer_label: "Purchase price confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure?" beds: - page_header: "How many bedrooms does the property have?" + page_header: "" check_answer_label: "Number of bedrooms" hint_text: "A bedsit has 1 bedroom." - question_text: "" + question_text: "How many bedrooms does the property have?" proptype: - page_header: "What type of unit is the property?" + page_header: "" check_answer_label: "Type of unit" hint_text: "" - question_text: "" + question_text: "What type of unit is the property?" monthly_charges_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Monthly charges confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" percentage_discount_value_check: - page_header: "Are you sure this is correct?" + page_header: "" check_answer_label: "Percentage discount confirmation" hint_text: "" - question_text: "" + question_text: "Are you sure this is correct?" builtype: - page_header: "What type of building is the property?" + page_header: "" check_answer_label: "Type of building" hint_text: "" - question_text: "" + question_text: "What type of building is the property?" wchair: - page_header: "Is the property built or adapted to wheelchair-user standards?" + page_header: "" check_answer_label: "Property built or adapted to wheelchair-user standards" hint_text: "" - question_text: "" - + question_text: "Is the property built or adapted to wheelchair-user standards?" From 2f5a811cd325a469448e8c7ef5ab22756d5bc67b Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:00:16 +0100 Subject: [PATCH 21/45] Indentation --- .../locales/forms/2023/sales/property.en.yml | 196 ++++++------- .../locales/forms/2024/sales/property.en.yml | 270 +++++++++--------- 2 files changed, 233 insertions(+), 233 deletions(-) diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index c92abe9cf..d79fc9353 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -1,113 +1,113 @@ en: - forms: - 2023: - sales: - property: - uprn: - page_header: "" - check_answer_label: "UPRN" - hint_text: "" - question_text: "What is the property's UPRN?" + forms: + 2023: + sales: + property: + uprn: + page_header: "" + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" - uprn_known: - page_header: "" - check_answer_label: "UPRN known?" - hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." - question_text: "Do you know the property's UPRN?" + uprn_known: + page_header: "" + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

+ The UPRN may not be the same as the property reference assigned by your organisation.

+ If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" - uprn_confirmed: - page_header: "We found an address that might be this property" - check_answer_label: "Is this the right address?" - hint_text: "" - question_text: "Is this the property address?" + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" - address: - page_header: "Q15 - What is the property's address?" - address_line1: - check_answer_label: "Address lines 1 and 2" - hint_text: "" - question_text: "Address line 1" - address_line2: - check_answer_label: "" - hint_text: "" - question_text: "Address line 2 (optional)" - town_or_city: - check_answer_label: "Town or city" - hint_text: "" - question_text: "Town or city" - county: - check_answer_label: "County" - hint_text: "" - question_text: "County (optional)" - postcode_full: - check_answer_label: "Postcode" - hint_text: "" - question_text: "Postcode" + address: + page_header: "Q15 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" - la: - page_header: "" - check_answer_label: "Local authority" - hint_text: "" - question_text: "What is the property’s local authority?" + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" - income1_value_check: - page_header: "" - check_answer_label: "Buyer 1 income confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" + income1_value_check: + page_header: "" + check_answer_label: "Buyer 1 income confirmation" + hint_text: "" + question_text: "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?" + income2_value_check": + page_header: "" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "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?" + combined_income_value_check: + page_header: "" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" - value_value_check: - page_header: "" - check_answer_label: "Purchase price confirmation" - hint_text: "" - question_text: "Are you sure?" + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" - beds: - page_header: "" - check_answer_label: "Number of bedrooms" - hint_text: "A bedsit has 1 bedroom." - question_text: "How many bedrooms does the property have?" + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "How many bedrooms does the property have?" - proptype: - page_header: "" - check_answer_label: "Type of unit" - hint_text: "" - question_text: "What type of unit is the property?" + proptype: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" - monthly_charges_value_check: - page_header: "" - check_answer_label: "Monthly charges confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" - percentage_discount_value_check: - page_header: "" - check_answer_label: "Percentage discount confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" - builtype: - page_header: "" - check_answer_label: "Type of building" - hint_text: "" - question_text: "What type of building is the property?" + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" - wchair: - page_header: "" - check_answer_label: "Property built or adapted to wheelchair-user standards" - hint_text: "" - question_text: "Is the property built or adapted to wheelchair-user standards?" + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "" + question_text: "Is the property built or adapted to wheelchair-user standards?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 61eaeb5bb..772685a12 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -1,136 +1,136 @@ en: - forms: - 2024: - sales: - property: - uprn: - page_header: "" - check_answer_label: "UPRN" - hint_text: "" - question_text: "What is the property's UPRN?" - - uprn_known: - page_header: "" - check_answer_label: "UPRN known?" - hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." - question_text: "Do you know the property's UPRN?" - - uprn_confirmed: - page_header: "We found an address that might be this property" - check_answer_label: "Is this the right address?" - hint_text: "" - question_text: "Is this the property address?" - - address_matcher: - page_header: "Find an address" - address_line1_input: - check_answer_label: "Find address" - hint_text: "" - question_text: "Address line 1" - postcode_full_input: - check_answer_label: "" - hint_text: "" - question_text: "Postcode" - - address_search_value_check: - page_header: "" - check_answer_label: "" - hint_text: "" - question_text: "No address found" - - uprn_selection: - page_header: "We found some addresses that might be this property" - check_answer_label: "Select the correct address" - hint_text: "" - question_text: "Select the correct address" - - address: - page_header: "Q12 - What is the property's address?" - address_line1: - check_answer_label: "Address lines 1 and 2" - hint_text: "" - question_text: "Address line 1" - address_line2: - check_answer_label: "" - hint_text: "" - question_text: "Address line 2 (optional)" - town_or_city: - check_answer_label: "Town or city" - hint_text: "" - question_text: "Town or city" - county: - check_answer_label: "County" - hint_text: "" - question_text: "County (optional)" - postcode_full: - check_answer_label: "Postcode" - hint_text: "" - question_text: "Postcode" - - la: - page_header: "" - check_answer_label: "Local authority" - hint_text: "" - question_text: "What is the property’s local authority?" - - income1_value_check: - page_header: "" - check_answer_label: "Buyer 1 income confirmation" - hint_text: "" - question_text: "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?" - - combined_income_value_check: - page_header: "" - check_answer_label: "Combined income confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - - value_value_check: - page_header: "" - check_answer_label: "Purchase price confirmation" - hint_text: "" - question_text: "Are you sure?" - - beds: - page_header: "" - check_answer_label: "Number of bedrooms" - hint_text: "A bedsit has 1 bedroom." - question_text: "How many bedrooms does the property have?" - - proptype: - page_header: "" - check_answer_label: "Type of unit" - hint_text: "" - question_text: "What type of unit is the property?" - - monthly_charges_value_check: - page_header: "" - check_answer_label: "Monthly charges confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - - percentage_discount_value_check: - page_header: "" - check_answer_label: "Percentage discount confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - - builtype: - page_header: "" - check_answer_label: "Type of building" - hint_text: "" - question_text: "What type of building is the property?" - - wchair: - page_header: "" - check_answer_label: "Property built or adapted to wheelchair-user standards" - hint_text: "" - question_text: "Is the property built or adapted to wheelchair-user standards?" + forms: + 2024: + sales: + property: + uprn: + page_header: "" + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" + + uprn_known: + page_header: "" + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

+ The UPRN may not be the same as the property reference assigned by your organisation.

+ If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" + + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" + + address_matcher: + page_header: "Find an address" + address_line1_input: + check_answer_label: "Find address" + hint_text: "" + question_text: "Address line 1" + postcode_full_input: + check_answer_label: "" + hint_text: "" + question_text: "Postcode" + + address_search_value_check: + page_header: "" + check_answer_label: "" + hint_text: "" + question_text: "No address found" + + uprn_selection: + page_header: "We found some addresses that might be this property" + check_answer_label: "Select the correct address" + hint_text: "" + question_text: "Select the correct address" + + address: + page_header: "Q12 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" + + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" + + income1_value_check: + page_header: "" + check_answer_label: "Buyer 1 income confirmation" + hint_text: "" + question_text: "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?" + + combined_income_value_check: + page_header: "" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "How many bedrooms does the property have?" + + proptype: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" + + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "" + question_text: "Is the property built or adapted to wheelchair-user standards?" From 4fd2c732e232d1377db3681105edf79dd9641093 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:37:46 +0100 Subject: [PATCH 22/45] Fix copy key --- app/models/form/sales/questions/buyer2_income_value_check.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/form/sales/questions/buyer2_income_value_check.rb b/app/models/form/sales/questions/buyer2_income_value_check.rb index bebdc1433..fccbd15fb 100644 --- a/app/models/form/sales/questions/buyer2_income_value_check.rb +++ b/app/models/form/sales/questions/buyer2_income_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "income2_value_check" - @copy_key = "soft_validations.income2_value_check" + @copy_key = "sales.property.income2_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, From 69e059446ef597e12f4fbc751a2272c823ec193c Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:39:22 +0100 Subject: [PATCH 23/45] Put hint text on one line --- config/locales/forms/2023/sales/property.en.yml | 4 +--- config/locales/forms/2024/sales/property.en.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index d79fc9353..3579b04b0 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -12,9 +12,7 @@ en: uprn_known: page_header: "" check_answer_label: "UPRN known?" - hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." question_text: "Do you know the property's UPRN?" uprn_confirmed: diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 772685a12..aec8f45b1 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -12,9 +12,7 @@ en: uprn_known: page_header: "" check_answer_label: "UPRN known?" - hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." question_text: "Do you know the property's UPRN?" uprn_confirmed: From 3840baafea2deac0d5f129a9bb8973e89c40c092 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:02:19 +0100 Subject: [PATCH 24/45] Add subsection method to page instance --- spec/models/form/sales/questions/uprn_confirmation_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb index ddb047937..b05da53bd 100644 --- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb @@ -5,7 +5,9 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + # let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + it "has correct page" do expect(question.page).to eq(page) From d7a2e19215d34a10cc8e7244e69d9c9823c5a39d Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:02:57 +0100 Subject: [PATCH 25/45] Remove comment --- spec/models/form/sales/questions/uprn_confirmation_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb index b05da53bd..f6cc91a33 100644 --- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb @@ -5,7 +5,6 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - # let(:page) { instance_double(Form::Page) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } From 331b308818a02be9930a64a36dbe5eeeac606206 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:27:36 +0100 Subject: [PATCH 26/45] Remove 2022-only property questions and pages --- .../form/lettings/pages/property_postcode.rb | 14 ------ .../form/lettings/questions/postcode_full.rb | 15 ------ .../form/lettings/questions/postcode_known.rb | 17 ------- .../subsections/property_information.rb | 6 +-- app/models/form/sales/pages/postcode.rb | 13 ----- .../sales/pages/property_local_authority.rb | 9 +--- app/models/form/sales/questions/postcode.rb | 22 --------- .../form/sales/questions/postcode_known.rb | 29 ------------ .../property_local_authority_known.rb | 26 ---------- .../sales/subsections/property_information.rb | 12 ----- .../subsections/property_information_spec.rb | 30 ------------ spec/models/form/sales/pages/postcode_spec.rb | 29 ------------ .../pages/property_local_authority_spec.rb | 13 ----- .../sales/questions/postcode_known_spec.rb | 47 ------------------- .../form/sales/questions/postcode_spec.rb | 46 ------------------ .../subsections/property_information_spec.rb | 24 ---------- 16 files changed, 2 insertions(+), 350 deletions(-) delete mode 100644 app/models/form/lettings/pages/property_postcode.rb delete mode 100644 app/models/form/lettings/questions/postcode_full.rb delete mode 100644 app/models/form/lettings/questions/postcode_known.rb delete mode 100644 app/models/form/sales/pages/postcode.rb delete mode 100644 app/models/form/sales/questions/postcode.rb delete mode 100644 app/models/form/sales/questions/postcode_known.rb delete mode 100644 app/models/form/sales/questions/property_local_authority_known.rb delete mode 100644 spec/models/form/sales/pages/postcode_spec.rb delete mode 100644 spec/models/form/sales/questions/postcode_known_spec.rb delete mode 100644 spec/models/form/sales/questions/postcode_spec.rb diff --git a/app/models/form/lettings/pages/property_postcode.rb b/app/models/form/lettings/pages/property_postcode.rb deleted file mode 100644 index a40d4140f..000000000 --- a/app/models/form/lettings/pages/property_postcode.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Form::Lettings::Pages::PropertyPostcode < ::Form::Page - def initialize(id, hsh, subsection) - super - @id = "property_postcode" - @depends_on = [{ "is_general_needs?" => true }] - end - - def questions - @questions ||= [ - Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self), - Form::Lettings::Questions::PostcodeFull.new(nil, nil, self), - ] - end -end diff --git a/app/models/form/lettings/questions/postcode_full.rb b/app/models/form/lettings/questions/postcode_full.rb deleted file mode 100644 index fc7d7691b..000000000 --- a/app/models/form/lettings/questions/postcode_full.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Form::Lettings::Questions::PostcodeFull < ::Form::Question - def initialize(id, hsh, page) - super - @id = "postcode_full" - @check_answer_label = "Postcode" - @header = "What is the property’s postcode?" - @type = "text" - @width = 5 - @inferred_check_answers_value = [{ "condition" => { "postcode_known" => 0 }, "value" => "Not known" }] - @check_answers_card_number = 0 - @hint_text = "" - @inferred_answers = { "la" => { "is_la_inferred" => true } } - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - end -end diff --git a/app/models/form/lettings/questions/postcode_known.rb b/app/models/form/lettings/questions/postcode_known.rb deleted file mode 100644 index ea9adb06b..000000000 --- a/app/models/form/lettings/questions/postcode_known.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Form::Lettings::Questions::PostcodeKnown < ::Form::Question - def initialize(id, hsh, page) - super - @id = "postcode_known" - @check_answer_label = "Do you know the property postcode?" - @header = "Do you know the property’s postcode?" - @type = "radio" - @check_answers_card_number = 0 - @hint_text = "" - @answer_options = ANSWER_OPTIONS - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @conditional_for = { "postcode_full" => [1] } - @hidden_in_check_answers = { "depends_on" => [{ "postcode_known" => 0 }, { "postcode_known" => 1 }] } - end - - ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze -end diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb index 67a22c7f5..fce414a05 100644 --- a/app/models/form/lettings/subsections/property_information.rb +++ b/app/models/form/lettings/subsections/property_information.rb @@ -40,16 +40,12 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection Form::Lettings::Pages::UprnSelection.new(nil, nil, self), Form::Lettings::Pages::AddressFallback.new(nil, nil, self), ] - elsif form.start_date.year == 2023 + else [ Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), Form::Lettings::Pages::Address.new(nil, nil, self), ] - else - [ - Form::Lettings::Pages::PropertyPostcode.new(nil, nil, self), - ] end end diff --git a/app/models/form/sales/pages/postcode.rb b/app/models/form/sales/pages/postcode.rb deleted file mode 100644 index c40a18845..000000000 --- a/app/models/form/sales/pages/postcode.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Form::Sales::Pages::Postcode < ::Form::Page - def initialize(id, hsh, subsection) - super - @id = "property_postcode" - end - - def questions - @questions ||= [ - Form::Sales::Questions::PostcodeKnown.new(nil, nil, self), - Form::Sales::Questions::Postcode.new(nil, nil, self), - ] - end -end diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb index 30d96bef4..649a445f9 100644 --- a/app/models/form/sales/pages/property_local_authority.rb +++ b/app/models/form/sales/pages/property_local_authority.rb @@ -10,14 +10,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page def questions @questions ||= [ - la_known_question, Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self), - ].compact - end - - def la_known_question #TODO: Pre 2023, could be removed? Only used here. - if form.start_date.year < 2023 - Form::Sales::Questions::PropertyLocalAuthorityKnown.new(nil, nil, self) - end + ] end end diff --git a/app/models/form/sales/questions/postcode.rb b/app/models/form/sales/questions/postcode.rb deleted file mode 100644 index 55e33199a..000000000 --- a/app/models/form/sales/questions/postcode.rb +++ /dev/null @@ -1,22 +0,0 @@ -class Form::Sales::Questions::Postcode < ::Form::Question - def initialize(id, hsh, page) - super - @id = "postcode_full" - @check_answer_label = "Property’s postcode" - @header = "Postcode" - @type = "text" - @width = 5 - @inferred_check_answers_value = [{ - "condition" => { - "pcodenk" => 1, - }, - "value" => "Not known", - }] - @inferred_answers = { - "la" => { - "is_la_inferred" => true, - }, - } - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - end -end diff --git a/app/models/form/sales/questions/postcode_known.rb b/app/models/form/sales/questions/postcode_known.rb deleted file mode 100644 index 10a3e2765..000000000 --- a/app/models/form/sales/questions/postcode_known.rb +++ /dev/null @@ -1,29 +0,0 @@ -class Form::Sales::Questions::PostcodeKnown < ::Form::Question - def initialize(id, hsh, page) - super - @id = "pcodenk" - @check_answer_label = "Property’s postcode" - @header = "Do you know the property’s postcode?" - @type = "radio" - @answer_options = ANSWER_OPTIONS - @conditional_for = { - "postcode_full" => [0], - } - @hidden_in_check_answers = { - "depends_on" => [ - { - "pcodenk" => 0, - }, - { - "pcodenk" => 1, - }, - ], - } - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - end - - ANSWER_OPTIONS = { - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }.freeze -end diff --git a/app/models/form/sales/questions/property_local_authority_known.rb b/app/models/form/sales/questions/property_local_authority_known.rb deleted file mode 100644 index b18486c6a..000000000 --- a/app/models/form/sales/questions/property_local_authority_known.rb +++ /dev/null @@ -1,26 +0,0 @@ -class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question - def initialize(id, hsh, page) - super - @id = "la_known" - @check_answer_label = "Local authority known" - @header = "Do you know the property’s local authority?" - @type = "radio" - @answer_options = ANSWER_OPTIONS - @conditional_for = { "la" => [1] } - @hidden_in_check_answers = { - "depends_on" => [ - { - "la_known" => 1, - }, - ], - } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] - end - - ANSWER_OPTIONS = { - "1" => { "value" => "Yes" }, - "0" => { "value" => "No" }, - }.freeze - - QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze -end diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index 43bf4e9e7..c59c159ae 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -16,7 +16,6 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self), Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self), (uprn_questions if form.start_date.year == 2023), - (postcode_and_la_questions if form.start_date.year < 2023), #TODO: Pre 2023, could be removed? Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self), ].flatten.compact end @@ -49,15 +48,4 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection ] end end - - def postcode_and_la_questions #TODO: Pre 2023, could be removed? - [ - Form::Sales::Pages::Postcode.new(nil, nil, self), - Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self), - Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil), - Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil), - Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil), - Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self), - ] - end end diff --git a/spec/models/form/lettings/subsections/property_information_spec.rb b/spec/models/form/lettings/subsections/property_information_spec.rb index 7d406d1a7..69b1d296e 100644 --- a/spec/models/form/lettings/subsections/property_information_spec.rb +++ b/spec/models/form/lettings/subsections/property_information_spec.rb @@ -17,36 +17,6 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(false) end - context "when 2022" do - let(:start_date) { Time.utc(2022, 2, 8) } - - it "has correct pages" do - expect(property_information.pages.compact.map(&:id)).to eq( - %w[ - property_postcode - property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check - first_time_property_let_as_social_housing - property_let_type - property_vacancy_reason_not_first_let - property_vacancy_reason_first_let - property_number_of_times_relet - property_unit_type - property_building_type - property_wheelchair_accessible - property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check - void_date - void_date_value_check - property_major_repairs - property_major_repairs_value_check - ], - ) - end - end - context "when 2023" do let(:start_date) { Time.utc(2023, 2, 8) } diff --git a/spec/models/form/sales/pages/postcode_spec.rb b/spec/models/form/sales/pages/postcode_spec.rb deleted file mode 100644 index 8f9c7273c..000000000 --- a/spec/models/form/sales/pages/postcode_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Sales::Pages::Postcode, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } - - let(:page_id) { nil } - let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } - - it "has correct subsection" do - expect(page.subsection).to eq(subsection) - end - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq(%w[pcodenk postcode_full]) - end - - it "has the correct id" do - expect(page.id).to eq("property_postcode") - end - - it "has the correct description" do - expect(page.description).to be_nil - end - - it "has correct depends_on" do - expect(page.depends_on).to be_nil - end -end diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb index 016d0534d..faba75665 100644 --- a/spec/models/form/sales/pages/property_local_authority_spec.rb +++ b/spec/models/form/sales/pages/property_local_authority_spec.rb @@ -18,19 +18,6 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do end describe "has correct questions" do - context "when 2022" do - let(:start_date) { Time.utc(2022, 2, 8) } - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq( - %w[ - la_known - la - ], - ) - end - end - context "when 2023" do let(:start_date) { Time.utc(2023, 2, 8) } diff --git a/spec/models/form/sales/questions/postcode_known_spec.rb b/spec/models/form/sales/questions/postcode_known_spec.rb deleted file mode 100644 index 794c981d4..000000000 --- a/spec/models/form/sales/questions/postcode_known_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } - - let(:question_id) { nil } - let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } - - it "has correct page" do - expect(question.page).to eq(page) - end - - it "has the correct id" do - expect(question.id).to eq("pcodenk") - end - - it "has the correct type" do - expect(question.type).to eq("radio") - end - - it "is not marked as derived" do - expect(question.derived?(nil)).to be false - end - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) - end - - it "has correct conditional for" do - expect(question.conditional_for).to eq({ - "postcode_full" => [0], - }) - end - - it "has the correct hidden_in_check_answers" do - expect(question.hidden_in_check_answers).to eq({ - "depends_on" => [ - { "pcodenk" => 0 }, - { "pcodenk" => 1 }, - ], - }) - end -end diff --git a/spec/models/form/sales/questions/postcode_spec.rb b/spec/models/form/sales/questions/postcode_spec.rb deleted file mode 100644 index 480d6af60..000000000 --- a/spec/models/form/sales/questions/postcode_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Sales::Questions::Postcode, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } - - let(:question_id) { nil } - let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } - - it "has correct page" do - expect(question.page).to eq(page) - end - - it "has the correct id" do - expect(question.id).to eq("postcode_full") - end - - it "has the correct type" do - expect(question.type).to eq("text") - end - - it "is not marked as derived" do - expect(question.derived?(nil)).to be false - end - - it "has the correct width" do - expect(question.width).to eq(5) - end - - it "has the correct inferred_answers" do - expect(question.inferred_answers).to eq({ - "la" => { - "is_la_inferred" => true, - }, - }) - end - - it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([{ - "condition" => { - "pcodenk" => 1, - }, - "value" => "Not known", - }]) - end -end diff --git a/spec/models/form/sales/subsections/property_information_spec.rb b/spec/models/form/sales/subsections/property_information_spec.rb index e0bf51e11..6e181f738 100644 --- a/spec/models/form/sales/subsections/property_information_spec.rb +++ b/spec/models/form/sales/subsections/property_information_spec.rb @@ -17,30 +17,6 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(false) end - context "when 2022" do - let(:start_date) { Time.utc(2022, 2, 8) } - - it "has correct pages" do - expect(property_information.pages.compact.map(&:id)).to eq( - %w[ - property_number_of_bedrooms - about_price_bedrooms_value_check - property_unit_type - monthly_charges_property_type_value_check - percentage_discount_proptype_value_check - property_building_type - property_postcode - property_local_authority - local_authority_buyer_1_income_max_value_check - local_authority_buyer_2_income_max_value_check - local_authority_combined_income_max_value_check - about_price_la_value_check - property_wheelchair_accessible - ], - ) - end - end - context "when 2023" do let(:start_date) { Time.utc(2023, 2, 8) } From e43c86e2362c75149e62d55cf5c9626dea8287a0 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:10:26 +0100 Subject: [PATCH 27/45] Fix lint --- spec/models/form/sales/questions/uprn_confirmation_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb index f6cc91a33..a9c58b2c9 100644 --- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb @@ -7,7 +7,6 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do let(:question_definition) { nil } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } - it "has correct page" do expect(question.page).to eq(page) end From a035a221e7949311a605e91e06cc2163860ce10e Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:57:23 +0100 Subject: [PATCH 28/45] Keep default page header for uprn confirmation and selection --- app/models/form/sales/pages/uprn_confirmation.rb | 2 +- app/models/form/sales/pages/uprn_selection.rb | 2 +- config/locales/forms/2023/sales/property.en.yml | 2 +- config/locales/forms/2024/sales/property.en.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb index c7e6858df..a875a9c1f 100644 --- a/app/models/form/sales/pages/uprn_confirmation.rb +++ b/app/models/form/sales/pages/uprn_confirmation.rb @@ -1,7 +1,7 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page def initialize(id, hsh, subsection) super - @id = "uprn_confirmation" + @header = "We found an address that might be this property" @copy_key = "sales.property.uprn_confirmed" end diff --git a/app/models/form/sales/pages/uprn_selection.rb b/app/models/form/sales/pages/uprn_selection.rb index b6188ec30..94f35540f 100644 --- a/app/models/form/sales/pages/uprn_selection.rb +++ b/app/models/form/sales/pages/uprn_selection.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::UprnSelection < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_selection" - @copy_key = "sales.property.uprn_selection" + @header = "We found some addresses that might be this property" @depends_on = [ { "uprn_known" => nil, "address_options_present?" => true }, { "uprn_known" => 0, "address_options_present?" => true }, diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index 3579b04b0..6c412f62e 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "We found an address that might be this property" + page_header: "" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index aec8f45b1..1e145c725 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "We found an address that might be this property" + page_header: "" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" @@ -39,7 +39,7 @@ en: question_text: "No address found" uprn_selection: - page_header: "We found some addresses that might be this property" + page_header: "" check_answer_label: "Select the correct address" hint_text: "" question_text: "Select the correct address" From df45443f6c6f56207d840ae49066a1edf8da2bf0 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:40:05 +0100 Subject: [PATCH 29/45] Keep existing header and check answer label for about price value check, common to other subsections --- app/models/form/sales/questions/about_price_value_check.rb | 3 ++- config/locales/forms/2023/sales/property.en.yml | 6 ------ config/locales/forms/2024/sales/property.en.yml | 6 ------ 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb index a09bf25d4..2b51cd7fb 100644 --- a/app/models/form/sales/questions/about_price_value_check.rb +++ b/app/models/form/sales/questions/about_price_value_check.rb @@ -2,7 +2,8 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "value_value_check" - @copy_key = "sales.property.value_value_check" + @check_answer_label = "Purchase price confirmation" + @header = "Are you sure?" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index 6c412f62e..4f48c11a7 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -68,12 +68,6 @@ en: hint_text: "" question_text: "Are you sure this is correct?" - value_value_check: - page_header: "" - check_answer_label: "Purchase price confirmation" - hint_text: "" - question_text: "Are you sure?" - beds: page_header: "" check_answer_label: "Number of bedrooms" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 1e145c725..ce3c1f41e 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -91,12 +91,6 @@ en: hint_text: "" question_text: "Are you sure this is correct?" - value_value_check: - page_header: "" - check_answer_label: "Purchase price confirmation" - hint_text: "" - question_text: "Are you sure?" - beds: page_header: "" check_answer_label: "Number of bedrooms" From 4380e440a8ee1073844bdb240a2e78b20f22d18b Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:45:48 +0100 Subject: [PATCH 30/45] Keep existing details for buyer income 1 and 2 check, common to other subsections --- .../sales/questions/buyer1_income_value_check.rb | 3 ++- .../sales/questions/buyer2_income_value_check.rb | 3 ++- config/locales/forms/2023/sales/property.en.yml | 12 ------------ config/locales/forms/2024/sales/property.en.yml | 12 ------------ 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/app/models/form/sales/questions/buyer1_income_value_check.rb b/app/models/form/sales/questions/buyer1_income_value_check.rb index 136cd2112..63e3b6478 100644 --- a/app/models/form/sales/questions/buyer1_income_value_check.rb +++ b/app/models/form/sales/questions/buyer1_income_value_check.rb @@ -2,7 +2,8 @@ class Form::Sales::Questions::Buyer1IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "income1_value_check" - @copy_key = "sales.property.income1_value_check" + @check_answer_label = "Buyer 1 income confirmation" + @header = "Are you sure this is correct?" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/buyer2_income_value_check.rb b/app/models/form/sales/questions/buyer2_income_value_check.rb index fccbd15fb..37b6cb380 100644 --- a/app/models/form/sales/questions/buyer2_income_value_check.rb +++ b/app/models/form/sales/questions/buyer2_income_value_check.rb @@ -2,7 +2,8 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "income2_value_check" - @copy_key = "sales.property.income2_value_check" + @check_answer_label = "Buyer 2 income confirmation" + @header = "Are you sure this is correct?" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index 4f48c11a7..aaeb62bfd 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -50,18 +50,6 @@ en: hint_text: "" question_text: "What is the property’s local authority?" - income1_value_check: - page_header: "" - check_answer_label: "Buyer 1 income confirmation" - hint_text: "" - question_text: "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?" - combined_income_value_check: page_header: "" check_answer_label: "Combined income confirmation" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index ce3c1f41e..922690df6 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -73,18 +73,6 @@ en: hint_text: "" question_text: "What is the property’s local authority?" - income1_value_check: - page_header: "" - check_answer_label: "Buyer 1 income confirmation" - hint_text: "" - question_text: "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?" - combined_income_value_check: page_header: "" check_answer_label: "Combined income confirmation" From d7e2a6bf8dcb2c2efc3c9b8c8e3b3a2ed5766a87 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:49:00 +0100 Subject: [PATCH 31/45] Keep existing details for combined income check, common to other subsections --- .../form/sales/questions/combined_income_value_check.rb | 3 ++- config/locales/forms/2023/sales/property.en.yml | 6 ------ config/locales/forms/2024/sales/property.en.yml | 6 ------ 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/app/models/form/sales/questions/combined_income_value_check.rb b/app/models/form/sales/questions/combined_income_value_check.rb index 01377512f..47cafeaa2 100644 --- a/app/models/form/sales/questions/combined_income_value_check.rb +++ b/app/models/form/sales/questions/combined_income_value_check.rb @@ -2,7 +2,8 @@ class Form::Sales::Questions::CombinedIncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "combined_income_value_check" - @copy_key = "sales.property.combined_income_value_check" + @check_answer_label = "Combined income confirmation" + @header = "Are you sure this is correct?" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index aaeb62bfd..6c647ea80 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -50,12 +50,6 @@ en: hint_text: "" question_text: "What is the property’s local authority?" - combined_income_value_check: - page_header: "" - check_answer_label: "Combined income confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - beds: page_header: "" check_answer_label: "Number of bedrooms" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 922690df6..5d5e787ce 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -73,12 +73,6 @@ en: hint_text: "" question_text: "What is the property’s local authority?" - combined_income_value_check: - page_header: "" - check_answer_label: "Combined income confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - beds: page_header: "" check_answer_label: "Number of bedrooms" From bc5ba65b8873d5fca2e8012c1b9f3be9a38dffd1 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:49:35 +0100 Subject: [PATCH 32/45] Keep existing details for monthly charged check, common to other subsections --- .../form/sales/questions/monthly_charges_value_check.rb | 3 ++- config/locales/forms/2023/sales/property.en.yml | 6 ------ config/locales/forms/2024/sales/property.en.yml | 6 ------ 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb index 71abc1888..90fcf4545 100644 --- a/app/models/form/sales/questions/monthly_charges_value_check.rb +++ b/app/models/form/sales/questions/monthly_charges_value_check.rb @@ -2,7 +2,8 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "monthly_charges_value_check" - @copy_key = "sales.property.monthly_charges_value_check" + @check_answer_label = "Monthly charges confirmation" + @header = "Are you sure this is correct?" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index 6c647ea80..444f2e9f5 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -62,12 +62,6 @@ en: hint_text: "" question_text: "What type of unit is the property?" - monthly_charges_value_check: - page_header: "" - check_answer_label: "Monthly charges confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - percentage_discount_value_check: page_header: "" check_answer_label: "Percentage discount confirmation" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 5d5e787ce..b3020ce2a 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -85,12 +85,6 @@ en: hint_text: "" question_text: "What type of unit is the property?" - monthly_charges_value_check: - page_header: "" - check_answer_label: "Monthly charges confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - percentage_discount_value_check: page_header: "" check_answer_label: "Percentage discount confirmation" From 037f2c6c3c339a0bf56b8a032b6d45e0e7faa76d Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:53:38 +0100 Subject: [PATCH 33/45] Remove translation --- config/locales/forms/2023/sales/property.en.yml | 6 ------ config/locales/forms/2024/sales/property.en.yml | 6 ------ 2 files changed, 12 deletions(-) diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index 444f2e9f5..e4d928469 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -62,12 +62,6 @@ en: hint_text: "" question_text: "What type of unit is the property?" - percentage_discount_value_check: - page_header: "" - check_answer_label: "Percentage discount confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - builtype: page_header: "" check_answer_label: "Type of building" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index b3020ce2a..2400d744c 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -85,12 +85,6 @@ en: hint_text: "" question_text: "What type of unit is the property?" - percentage_discount_value_check: - page_header: "" - check_answer_label: "Percentage discount confirmation" - hint_text: "" - question_text: "Are you sure this is correct?" - builtype: page_header: "" check_answer_label: "Type of building" From b7c3222a35bdd3ba0518a48a5f8f906012470d5f Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:03:55 +0100 Subject: [PATCH 34/45] Add back removed id --- app/models/form/sales/pages/uprn_confirmation.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb index a875a9c1f..0869532b2 100644 --- a/app/models/form/sales/pages/uprn_confirmation.rb +++ b/app/models/form/sales/pages/uprn_confirmation.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page def initialize(id, hsh, subsection) super + @id = "uprn_confirmation" @header = "We found an address that might be this property" @copy_key = "sales.property.uprn_confirmed" end From 16e16117d31a669ecb800af3044634f8c904de35 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:21:18 +0100 Subject: [PATCH 35/45] Remove copy key from uprn_confirmation --- app/models/form/sales/pages/uprn_confirmation.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb index 0869532b2..d553972a3 100644 --- a/app/models/form/sales/pages/uprn_confirmation.rb +++ b/app/models/form/sales/pages/uprn_confirmation.rb @@ -3,7 +3,6 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page super @id = "uprn_confirmation" @header = "We found an address that might be this property" - @copy_key = "sales.property.uprn_confirmed" end def questions From 498c32baaaaa4ba60fa88daece040c0e02a163c6 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:29:22 +0100 Subject: [PATCH 36/45] Add sales soft validations --- .../questions/about_price_value_check.rb | 3 +- .../questions/buyer1_income_value_check.rb | 3 +- .../questions/buyer2_income_value_check.rb | 5 +-- .../questions/combined_income_value_check.rb | 3 +- .../questions/monthly_charges_value_check.rb | 3 +- .../percentage_discount_value_check.rb | 3 +- .../forms/2023/sales/soft_validations.en.yml | 40 +++++++++++++++++++ .../forms/2024/sales/soft_validations.en.yml | 40 +++++++++++++++++++ 8 files changed, 87 insertions(+), 13 deletions(-) create mode 100644 config/locales/forms/2023/sales/soft_validations.en.yml create mode 100644 config/locales/forms/2024/sales/soft_validations.en.yml diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb index 2b51cd7fb..52f7b156f 100644 --- a/app/models/form/sales/questions/about_price_value_check.rb +++ b/app/models/form/sales/questions/about_price_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "value_value_check" - @check_answer_label = "Purchase price confirmation" - @header = "Are you sure?" + @copy_key = "sales.soft_validations.value_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/buyer1_income_value_check.rb b/app/models/form/sales/questions/buyer1_income_value_check.rb index 63e3b6478..410bd53d5 100644 --- a/app/models/form/sales/questions/buyer1_income_value_check.rb +++ b/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:) super(id, hsh, page) @id = "income1_value_check" - @check_answer_label = "Buyer 1 income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.income1_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/buyer2_income_value_check.rb b/app/models/form/sales/questions/buyer2_income_value_check.rb index 37b6cb380..e635bda4a 100644 --- a/app/models/form/sales/questions/buyer2_income_value_check.rb +++ b/app/models/form/sales/questions/buyer2_income_value_check.rb @@ -1,9 +1,8 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) - @id = "income2_value_check" - @check_answer_label = "Buyer 2 income confirmation" - @header = "Are you sure this is correct?" + @id = "" + @copy_key = "sales.soft_validations.income2_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/combined_income_value_check.rb b/app/models/form/sales/questions/combined_income_value_check.rb index 47cafeaa2..c2688ffe5 100644 --- a/app/models/form/sales/questions/combined_income_value_check.rb +++ b/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:) super(id, hsh, page) @id = "combined_income_value_check" - @check_answer_label = "Combined income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.combined_income_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb index 90fcf4545..615238cda 100644 --- a/app/models/form/sales/questions/monthly_charges_value_check.rb +++ b/app/models/form/sales/questions/monthly_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "monthly_charges_value_check" - @check_answer_label = "Monthly charges confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.monthly_charges_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/percentage_discount_value_check.rb b/app/models/form/sales/questions/percentage_discount_value_check.rb index 9ac5547b4..5a1e7a045 100644 --- a/app/models/form/sales/questions/percentage_discount_value_check.rb +++ b/app/models/form/sales/questions/percentage_discount_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PercentageDiscountValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "percentage_discount_value_check" - @check_answer_label = "Percentage discount confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.percentage_discount_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml new file mode 100644 index 000000000..9a5f62247 --- /dev/null +++ b/config/locales/forms/2023/sales/soft_validations.en.yml @@ -0,0 +1,40 @@ +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?" + + income2_value_check: + page_header: "" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "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?" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml new file mode 100644 index 000000000..3e8828153 --- /dev/null +++ b/config/locales/forms/2024/sales/soft_validations.en.yml @@ -0,0 +1,40 @@ +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?" + + income2_value_check: + page_header: "" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "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?" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" From ff9d448db7abed41f7f76d456db9d158ec69af88 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:36:00 +0100 Subject: [PATCH 37/45] Remove page header for uprn confirmed --- config/locales/forms/2023/sales/property.en.yml | 2 +- config/locales/forms/2024/sales/property.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index e4d928469..f6d74d8e7 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "" + page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 2400d744c..c20151203 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "" + page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" From ea6a84f2399a525037bf8b1a95af0be4fb015217 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:36:19 +0100 Subject: [PATCH 38/45] Set uprn confirmation default header --- app/models/form/sales/pages/uprn_confirmation.rb | 1 - app/models/form/sales/questions/uprn_confirmation.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb index d553972a3..9cc2ccf94 100644 --- a/app/models/form/sales/pages/uprn_confirmation.rb +++ b/app/models/form/sales/pages/uprn_confirmation.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_confirmation" - @header = "We found an address that might be this property" end def questions diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb index 467e50109..0e186721a 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -2,8 +2,8 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_confirmed" + @header = "We found an address that might be this property" @type = "radio" - @copy_key = "sales.property.uprn_confirmed" end def answer_options From d4d114e8a41b588b0b94bb02b3517e9acac2b379 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:36:37 +0100 Subject: [PATCH 39/45] Set uprn selection default header --- app/models/form/sales/pages/uprn_selection.rb | 1 - app/models/form/sales/questions/uprn_selection.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/form/sales/pages/uprn_selection.rb b/app/models/form/sales/pages/uprn_selection.rb index 94f35540f..6dc5bb2bc 100644 --- a/app/models/form/sales/pages/uprn_selection.rb +++ b/app/models/form/sales/pages/uprn_selection.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnSelection < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_selection" - @header = "We found some addresses that might be this property" @depends_on = [ { "uprn_known" => nil, "address_options_present?" => true }, { "uprn_known" => 0, "address_options_present?" => true }, diff --git a/app/models/form/sales/questions/uprn_selection.rb b/app/models/form/sales/questions/uprn_selection.rb index 6b512f869..83bddcbd5 100644 --- a/app/models/form/sales/questions/uprn_selection.rb +++ b/app/models/form/sales/questions/uprn_selection.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_selection" - @copy_key = "sales.property.uprn_selection" + @header = "We found some addresses that might be this property" @type = "radio" @disable_clearing_if_not_routed_or_dynamic_answer_options = true end From 105a0b98a77e1882d0d363f70dcd70ba82772145 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:43:53 +0100 Subject: [PATCH 40/45] Add missing id --- app/models/form/sales/questions/buyer2_income_value_check.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/form/sales/questions/buyer2_income_value_check.rb b/app/models/form/sales/questions/buyer2_income_value_check.rb index e635bda4a..6b0bab5c2 100644 --- a/app/models/form/sales/questions/buyer2_income_value_check.rb +++ b/app/models/form/sales/questions/buyer2_income_value_check.rb @@ -1,7 +1,7 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) - @id = "" + @id = "income2_value_check" @copy_key = "sales.soft_validations.income2_value_check" @type = "interruption_screen" @answer_options = { From d40a5a4a126e761463b1e5b29fb022380fbf92c6 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:47:21 +0100 Subject: [PATCH 41/45] Remove page header from translations file, it is a default header --- config/locales/forms/2023/sales/property.en.yml | 2 +- config/locales/forms/2024/sales/property.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index f6d74d8e7..e4d928469 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "We found an address that might be this property" + page_header: "" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index c20151203..2400d744c 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "We found an address that might be this property" + page_header: "" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" From 6840794ee3f5e8f277305182bd64031ba151dbff Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:48:29 +0100 Subject: [PATCH 42/45] Correct uprn confirmed header back to original --- app/models/form/sales/questions/uprn_confirmation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb index 0e186721a..cf015c8ce 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_confirmed" - @header = "We found an address that might be this property" + @header = "Is this the property address?" @type = "radio" end From 9f700a3149ada44eb42877d01ba5a639e4cf3c66 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:51:20 +0100 Subject: [PATCH 43/45] Correct uprn selection header back to original --- app/models/form/sales/questions/uprn_selection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/form/sales/questions/uprn_selection.rb b/app/models/form/sales/questions/uprn_selection.rb index 83bddcbd5..7ed47f9cc 100644 --- a/app/models/form/sales/questions/uprn_selection.rb +++ b/app/models/form/sales/questions/uprn_selection.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_selection" - @header = "We found some addresses that might be this property" + @header = "Select the correct address" @type = "radio" @disable_clearing_if_not_routed_or_dynamic_answer_options = true end From 14e7e15c8aa3f9daa95916cd8b7cbe850fe05fff Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:58:33 +0100 Subject: [PATCH 44/45] Put back page header --- config/locales/forms/2023/sales/property.en.yml | 2 +- config/locales/forms/2024/sales/property.en.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index e4d928469..f6d74d8e7 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "" + page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index 2400d744c..ddbfeeb47 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -16,7 +16,7 @@ en: question_text: "Do you know the property's UPRN?" uprn_confirmed: - page_header: "" + page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" question_text: "Is this the property address?" @@ -39,7 +39,7 @@ en: question_text: "No address found" uprn_selection: - page_header: "" + page_header: "We found an address that might be this property" check_answer_label: "Select the correct address" hint_text: "" question_text: "Select the correct address" From 06f66bf777caa53856602d9324a5ad11b9e553f1 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:07:44 +0100 Subject: [PATCH 45/45] Remove or include copy key where appropriate --- app/models/form/sales/pages/address_matcher.rb | 2 +- app/models/form/sales/questions/no_address_found.rb | 1 - app/models/form/sales/questions/property_local_authority.rb | 1 - app/models/form/sales/questions/uprn.rb | 1 - app/models/form/sales/questions/uprn_confirmation.rb | 1 - app/models/form/sales/questions/uprn_known.rb | 1 - app/models/form/sales/questions/uprn_selection.rb | 1 - config/locales/forms/2023/sales/property.en.yml | 2 +- config/locales/forms/2024/sales/property.en.yml | 2 +- 9 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/models/form/sales/pages/address_matcher.rb b/app/models/form/sales/pages/address_matcher.rb index 5384ec4c1..8e1a8e272 100644 --- a/app/models/form/sales/pages/address_matcher.rb +++ b/app/models/form/sales/pages/address_matcher.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressMatcher < ::Form::Page def initialize(id, hsh, subsection) super @id = "address_matcher" - @header = "sales.property.address_matcher" + @copy_key = "sales.property.address_matcher" @depends_on = [ { "uprn_known" => nil }, { "uprn_known" => 0 }, diff --git a/app/models/form/sales/questions/no_address_found.rb b/app/models/form/sales/questions/no_address_found.rb index c623c3da5..38a673378 100644 --- a/app/models/form/sales/questions/no_address_found.rb +++ b/app/models/form/sales/questions/no_address_found.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::NoAddressFound < ::Form::Question def initialize(id, hsh, page) super @id = "address_search_value_check" - @copy_key = "sales.property.address_search_value_check" @type = "interruption_screen" @hidden_in_check_answers = true end diff --git a/app/models/form/sales/questions/property_local_authority.rb b/app/models/form/sales/questions/property_local_authority.rb index 3b7c55651..053ee8fde 100644 --- a/app/models/form/sales/questions/property_local_authority.rb +++ b/app/models/form/sales/questions/property_local_authority.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question def initialize(id, hsh, page) super @id = "la" - @copy_key = "sales.property.la" @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @disable_clearing_if_not_routed_or_dynamic_answer_options = true diff --git a/app/models/form/sales/questions/uprn.rb b/app/models/form/sales/questions/uprn.rb index 25daf66b7..5cf493131 100644 --- a/app/models/form/sales/questions/uprn.rb +++ b/app/models/form/sales/questions/uprn.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::Uprn < ::Form::Question def initialize(id, hsh, page) super @id = "uprn" - @copy_key = "sales.property.uprn" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb index cf015c8ce..94c1afa36 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_confirmed" - @header = "Is this the property address?" @type = "radio" end diff --git a/app/models/form/sales/questions/uprn_known.rb b/app/models/form/sales/questions/uprn_known.rb index 5ddcdc324..9b200894e 100644 --- a/app/models/form/sales/questions/uprn_known.rb +++ b/app/models/form/sales/questions/uprn_known.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::UprnKnown < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_known" - @copy_key = "sales.property.uprn_known" @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { "uprn" => [1] } diff --git a/app/models/form/sales/questions/uprn_selection.rb b/app/models/form/sales/questions/uprn_selection.rb index 7ed47f9cc..282aed353 100644 --- a/app/models/form/sales/questions/uprn_selection.rb +++ b/app/models/form/sales/questions/uprn_selection.rb @@ -2,7 +2,6 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_selection" - @header = "Select the correct address" @type = "radio" @disable_clearing_if_not_routed_or_dynamic_answer_options = true end diff --git a/config/locales/forms/2023/sales/property.en.yml b/config/locales/forms/2023/sales/property.en.yml index f6d74d8e7..d463ebe02 100644 --- a/config/locales/forms/2023/sales/property.en.yml +++ b/config/locales/forms/2023/sales/property.en.yml @@ -19,7 +19,7 @@ en: page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" - question_text: "Is this the property address?" + question_text: "Select the correct address" address: page_header: "Q15 - What is the property's address?" diff --git a/config/locales/forms/2024/sales/property.en.yml b/config/locales/forms/2024/sales/property.en.yml index ddbfeeb47..42d85b172 100644 --- a/config/locales/forms/2024/sales/property.en.yml +++ b/config/locales/forms/2024/sales/property.en.yml @@ -19,7 +19,7 @@ en: page_header: "We found an address that might be this property" check_answer_label: "Is this the right address?" hint_text: "" - question_text: "Is this the property address?" + question_text: "Select the correct address" address_matcher: page_header: "Find an address"