Browse Source

CLDC-3650: Move copy for sales setup section to translation files (#2672)

pull/2697/head^2
Rachael Booth 3 months ago committed by GitHub
parent
commit
731dcc9325
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      app/models/form/page.rb
  2. 30
      app/models/form/question.rb
  3. 1
      app/models/form/sales/pages/buyer_interview.rb
  4. 6
      app/models/form/sales/pages/discounted_ownership_type.rb
  5. 6
      app/models/form/sales/pages/outright_ownership_type.rb
  6. 2
      app/models/form/sales/pages/privacy_notice.rb
  7. 6
      app/models/form/sales/pages/shared_ownership_type.rb
  8. 2
      app/models/form/sales/questions/buyer_company.rb
  9. 4
      app/models/form/sales/questions/buyer_interview.rb
  10. 2
      app/models/form/sales/questions/buyer_live.rb
  11. 2
      app/models/form/sales/questions/created_by_id.rb
  12. 3
      app/models/form/sales/questions/discounted_ownership_type.rb
  13. 8
      app/models/form/sales/questions/joint_purchase.rb
  14. 2
      app/models/form/sales/questions/managing_organisation.rb
  15. 10
      app/models/form/sales/questions/number_joint_buyers.rb
  16. 3
      app/models/form/sales/questions/other_ownership_type.rb
  17. 3
      app/models/form/sales/questions/outright_ownership_type.rb
  18. 2
      app/models/form/sales/questions/ownership_scheme.rb
  19. 2
      app/models/form/sales/questions/owning_organisation_id.rb
  20. 3
      app/models/form/sales/questions/privacy_notice.rb
  21. 3
      app/models/form/sales/questions/purchaser_code.rb
  22. 2
      app/models/form/sales/questions/sale_date.rb
  23. 11
      app/models/form/sales/questions/shared_ownership_type.rb
  24. 2
      app/views/form/_date_question.html.erb
  25. 110
      config/locales/forms/2023/sales/setup.en.yml
  26. 110
      config/locales/forms/2024/sales/setup.en.yml
  27. 4
      spec/models/form/lettings/pages/address_fallback_spec.rb
  28. 4
      spec/models/form/lettings/pages/address_matcher_spec.rb
  29. 4
      spec/models/form/lettings/pages/address_spec.rb
  30. 4
      spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb
  31. 4
      spec/models/form/lettings/pages/created_by_spec.rb
  32. 4
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb
  33. 4
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb
  34. 4
      spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb
  35. 4
      spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb
  36. 4
      spec/models/form/lettings/pages/location_spec.rb
  37. 4
      spec/models/form/lettings/pages/managing_organisation_spec.rb
  38. 4
      spec/models/form/lettings/pages/max_rent_value_check_spec.rb
  39. 4
      spec/models/form/lettings/pages/min_rent_value_check_spec.rb
  40. 4
      spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb
  41. 4
      spec/models/form/lettings/pages/needs_type_spec.rb
  42. 4
      spec/models/form/lettings/pages/net_income_value_check_spec.rb
  43. 4
      spec/models/form/lettings/pages/no_address_found_spec.rb
  44. 4
      spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb
  45. 4
      spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb
  46. 4
      spec/models/form/lettings/pages/partner_under16_value_check_spec.rb
  47. 4
      spec/models/form/lettings/pages/person_age_spec.rb
  48. 4
      spec/models/form/lettings/pages/person_gender_identity_spec.rb
  49. 4
      spec/models/form/lettings/pages/person_known_spec.rb
  50. 4
      spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb
  51. 4
      spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb
  52. 4
      spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb
  53. 4
      spec/models/form/lettings/pages/person_working_situation_spec.rb
  54. 4
      spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb
  55. 4
      spec/models/form/lettings/pages/previous_housing_situation_spec.rb
  56. 4
      spec/models/form/lettings/pages/previous_local_authority_spec.rb
  57. 4
      spec/models/form/lettings/pages/previous_postcode_spec.rb
  58. 4
      spec/models/form/lettings/pages/property_local_authority_spec.rb
  59. 4
      spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb
  60. 4
      spec/models/form/lettings/pages/property_reference_spec.rb
  61. 4
      spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb
  62. 4
      spec/models/form/lettings/pages/renewal_spec.rb
  63. 4
      spec/models/form/lettings/pages/rent_type_spec.rb
  64. 4
      spec/models/form/lettings/pages/scheme_spec.rb
  65. 4
      spec/models/form/lettings/pages/sheltered_accommodation_spec.rb
  66. 4
      spec/models/form/lettings/pages/starter_tenancy_type_spec.rb
  67. 4
      spec/models/form/lettings/pages/stock_owner_spec.rb
  68. 4
      spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb
  69. 4
      spec/models/form/lettings/pages/tenancy_length_spec.rb
  70. 4
      spec/models/form/lettings/pages/tenancy_start_date_spec.rb
  71. 4
      spec/models/form/lettings/pages/tenancy_type_spec.rb
  72. 4
      spec/models/form/lettings/pages/tenant_code_spec.rb
  73. 4
      spec/models/form/lettings/pages/uprn_confirmation_spec.rb
  74. 4
      spec/models/form/lettings/pages/uprn_selection_spec.rb
  75. 4
      spec/models/form/lettings/pages/uprn_spec.rb
  76. 4
      spec/models/form/lettings/pages/void_date_spec.rb
  77. 12
      spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb
  78. 12
      spec/models/form/lettings/questions/address_line1_spec.rb
  79. 12
      spec/models/form/lettings/questions/address_line2_spec.rb
  80. 24
      spec/models/form/lettings/questions/age1_known_spec.rb
  81. 16
      spec/models/form/lettings/questions/age_known_spec.rb
  82. 26
      spec/models/form/lettings/questions/age_spec.rb
  83. 22
      spec/models/form/lettings/questions/beds_spec.rb
  84. 12
      spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb
  85. 12
      spec/models/form/lettings/questions/county_spec.rb
  86. 12
      spec/models/form/lettings/questions/created_by_id_spec.rb
  87. 12
      spec/models/form/lettings/questions/declaration_spec.rb
  88. 20
      spec/models/form/lettings/questions/details_known_spec.rb
  89. 16
      spec/models/form/lettings/questions/ethnic_white_spec.rb
  90. 28
      spec/models/form/lettings/questions/gender_identity1_spec.rb
  91. 24
      spec/models/form/lettings/questions/hb_spec.rb
  92. 8
      spec/models/form/lettings/questions/homeless_spec.rb
  93. 8
      spec/models/form/lettings/questions/housingneeds_other_spec.rb
  94. 8
      spec/models/form/lettings/questions/irproduct_other_spec.rb
  95. 8
      spec/models/form/lettings/questions/is_carehome_spec.rb
  96. 22
      spec/models/form/lettings/questions/joint_spec.rb
  97. 8
      spec/models/form/lettings/questions/layear_spec.rb
  98. 8
      spec/models/form/lettings/questions/letting_allocation_spec.rb
  99. 18
      spec/models/form/lettings/questions/location_id_spec.rb
  100. 12
      spec/models/form/lettings/questions/managing_organisation_spec.rb
  101. Some files were not shown because too many files have changed in this diff Show More

10
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
@ -24,6 +24,14 @@ class Form::Page
delegate :form, to: :subsection
def copy_key
@copy_key ||= "#{form.type}.#{subsection.id}.#{questions[0].id}"
end
def header
@header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.page_header", default: "")
end
def routed_to?(log, _current_user)
return true unless depends_on || subsection.depends_on

30
app/models/form/question.rb

@ -1,9 +1,9 @@
class Form::Question
include FormattingHelper
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,
@ -50,6 +50,22 @@ class Form::Question
delegate :subsection, to: :page
delegate :form, to: :subsection
def copy_key
@copy_key ||= "#{form.type}.#{subsection.id}.#{id}"
end
def 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", default: "")
end
def hint_text
@hint_text ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.hint_text", default: "")
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"
@ -206,7 +222,15 @@ class Form::Question
end
def error_display_label
label = error_label || check_answer_label || header || id.humanize
label = if error_label.present?
error_label
elsif check_answer_label.present?
check_answer_label
elsif header.present?
header
else
id.humanize
end
format_ending(label)
end

1
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

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "discounted_ownership_type"
@header = header
@copy_key = "sales.setup.type.discounted_ownership"
@depends_on = [{
"ownershipsch" => 2,
}]
@ -13,8 +13,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

6
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,
}]
@ -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" if form.start_date.year >= 2023
end
end

2
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

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "shared_ownership_type"
@header = header
@copy_key = "sales.setup.type.shared_ownership"
@depends_on = [{
"ownershipsch" => 1,
}]
@ -13,8 +13,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

2
app/models/form/sales/questions/buyer_company.rb

@ -2,8 +2,6 @@ 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?"
@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]

4
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

2
app/models/form/sales/questions/buyer_live.rb

@ -2,8 +2,6 @@ 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?"
@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]

2
app/models/form/sales/questions/created_by_id.rb

@ -4,8 +4,6 @@ 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?"
@derived = true
@type = "select"
end

3
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

8
app/models/form/sales/questions/joint_purchase.rb

@ -2,8 +2,6 @@ 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?"
@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 +12,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

2
app/models/form/sales/questions/managing_organisation.rb

@ -2,8 +2,6 @@ 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?"
@derived = true
@type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

10
app/models/form/sales/questions/number_joint_buyers.rb

@ -2,8 +2,6 @@ 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?"
@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 +13,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

3
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]

3
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

2
app/models/form/sales/questions/ownership_scheme.rb

@ -2,8 +2,6 @@ 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?"
@type = "radio"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

2
app/models/form/sales/questions/owning_organisation_id.rb

@ -2,8 +2,6 @@ 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?"
@derived = true
@type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

3
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

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

@ -2,9 +2,6 @@ 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."
@type = "text"
@width = 10
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

2
app/models/form/sales/questions/sale_date.rb

@ -2,8 +2,6 @@ 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?"
@type = "date"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

11
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
{

2
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 + "</br></br>".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" },
hint: { text: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "</br></br>".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 %>

110
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"
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"

110
config/locales/forms/2024/sales/setup.en.yml

@ -0,0 +1,110 @@
en:
forms:
2024:
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: "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"
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: "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: "Ministry of Housing, Communities and Local Government privacy notice"
check_answer_label: "Buyer has seen the privacy notice?"
hint_text: ""
question_text: "Declaration"

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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,

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

4
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

12
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

12
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

12
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

24
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

16
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],

26
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([
{

22
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) }

12
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" },

12
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

12
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

12
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)

20
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

16
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

28
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

24
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

8
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

8
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

8
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

8
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

22
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

8
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

8
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

18
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")

12
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" } }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save