You have created logs from your bulk upload, and the logs are complete. Return to sales logs to view them.
diff --git a/app/views/bulk_upload_sales_soft_validations_check/confirm.html.erb b/app/views/bulk_upload_sales_soft_validations_check/confirm.html.erb
index ca9f7fd4f..2b4a6e981 100644
--- a/app/views/bulk_upload_sales_soft_validations_check/confirm.html.erb
+++ b/app/views/bulk_upload_sales_soft_validations_check/confirm.html.erb
@@ -4,7 +4,7 @@
-
Bulk upload for sales (<%= @bulk_upload.year_combo %>)
+
Upload sales logs in bulk (<%= @bulk_upload.year_combo %>)
You have chosen to upload all logs from this bulk upload.
<%= logs_and_soft_validations_warning(@bulk_upload) %>
diff --git a/app/views/bulk_upload_sales_soft_validations_check/confirm_soft_errors.html.erb b/app/views/bulk_upload_sales_soft_validations_check/confirm_soft_errors.html.erb
index 4a2765ab4..0bf5553b3 100644
--- a/app/views/bulk_upload_sales_soft_validations_check/confirm_soft_errors.html.erb
+++ b/app/views/bulk_upload_sales_soft_validations_check/confirm_soft_errors.html.erb
@@ -3,7 +3,7 @@
<%= f.govuk_error_summary %>
-
Bulk upload for sales (<%= @bulk_upload.year_combo %>)
+
Upload sales logs in bulk (<%= @bulk_upload.year_combo %>)
Check these <%= pluralize(@bulk_upload.bulk_upload_errors.count, "answer") %>
Some data from your bulk upload might not be right. Check your file for any errors in the fields below.
diff --git a/app/views/logs/edit.html.erb b/app/views/logs/edit.html.erb
index 68bf78e87..3859ca6db 100644
--- a/app/views/logs/edit.html.erb
+++ b/app/views/logs/edit.html.erb
@@ -38,6 +38,6 @@
<%= render "tasklist" %>
- <%= edit_actions_for_log(@log) %>
+ <%= edit_actions_for_log(@log, bulk_upload_filter_applied) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index faced2c11..5412c8b2b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -290,9 +290,9 @@ en:
startdate:
current_collection_year:
- "Enter a date within the %{current_start_year_short}/%{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
+ "Enter a date within the %{current_start_year_short} to %{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
previous_and_current_collection_year:
- "Enter a date within the %{previous_start_year_short}/%{previous_end_year_short} or %{previous_end_year_short}/%{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
+ "Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
later_than_14_days_after: "The tenancy start date must not be later than 14 days from today’s date."
before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme."
after_void_date: "Enter a tenancy start date that is after the void date."
@@ -724,38 +724,23 @@ Make sure these answers are correct."
hint_text: "This is higher than we would expect."
shared_ownership_deposit:
title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
- old_persons_shared_ownership:
- title_text:
- one: "You told us the buyer is using the Older Persons Shared Ownership scheme."
- two: "You told us the buyers are using the Older Persons Shared Ownership scheme."
- hint_text: "At least one buyer must be aged 65 years and over to use this scheme."
staircase_bought_seems_high:
title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
hint_text: "Most staircasing transactions are less than 50%"
monthly_charges_over_soft_max:
title_text: "You told us that the monthly charges were %{mscharge}."
hint_text: "This is higher than we would expect."
- student_not_child:
- title_text: "You told us this person is a student aged between 16 and 19."
discounted_sale_value:
title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}."
informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}."
care_home_charges:
title_text: "Care home charges should be provided if this is a care home accommodation."
- buyer1_livein_wrong_for_ownership_type:
- title_text: "You told us that buyer 1 will not live in the property."
- hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property."
- buyer2_livein_wrong_for_ownership_type:
- title_text: "You told us that buyer 2 will not live in the property."
- hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property."
percentage_discount_value:
title_text: "You told us that the percentage discount is %{discount}."
hint_text: "This is higher than we would expect."
grant:
title_text: "You told us that the grant amount is %{grant}."
hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
- wheelchair:
- title_text: "You told us that someone in the household uses a wheelchair."
referral:
title_text: "Are you sure?"
hint_text: "This is a general needs log, and this referral type is for supported housing."
@@ -785,12 +770,8 @@ Make sure these answers are correct."
informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually."
partner_under_16_lettings:
title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant."
- partner_under_16_sales:
- title: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
multiple_partners_lettings:
title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant."
- multiple_partners_sales:
- title: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
devise:
two_factor_authentication:
diff --git a/config/locales/forms/2023/sales/household_characteristics.en.yml b/config/locales/forms/2023/sales/household_characteristics.en.yml
new file mode 100644
index 000000000..a49a817dc
--- /dev/null
+++ b/config/locales/forms/2023/sales/household_characteristics.en.yml
@@ -0,0 +1,357 @@
+en:
+ forms:
+ 2023:
+ sales:
+ household_characteristics:
+ 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"
+
+ age1:
+ page_header: ""
+ age1_known:
+ check_answer_label: "Buyer 1’s age"
+ hint_text: "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."
+ question_text: "Do you know buyer 1’s age?"
+ age1:
+ check_answer_label: "Buyer 1’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex1:
+ page_header: ""
+ check_answer_label: "Buyer 1’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes buyer 1’s gender identity?"
+
+ ethnic_group:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic group"
+ hint_text: "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."
+ question_text: "What is buyer 1’s ethnic group?"
+
+ ethnic:
+ ethnic_background_black:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: "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."
+ question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
+ ethnic_background_asian:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: "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."
+ question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?"
+ ethnic_background_arab:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: "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."
+ question_text: "Which of the following best describes buyer 1’s Arab background?"
+ ethnic_background_mixed:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: "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."
+ question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
+ ethnic_background_white:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: "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."
+ question_text: "Which of the following best describes buyer 1’s White background?"
+
+ national:
+ page_header: ""
+ check_answer_label: "Buyer 1’s nationality"
+ hint_text: "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."
+ question_text: "What is buyer 1’s nationality?"
+
+ ecstat1:
+ page_header: ""
+ check_answer_label: "Buyer 1's working situation"
+ hint_text: "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."
+ question_text: "Which of these best describes buyer 1's working situation?"
+
+ buy1livein:
+ page_header: ""
+ check_answer_label: "Will buyer 1 live in the property?"
+ hint_text: "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."
+ question_text: "Will buyer 1 live in the property?"
+
+ relat2:
+ buyer:
+ page_header: ""
+ check_answer_label: "Buyer 2's relationship to buyer 1"
+ hint_text: ""
+ question_text: "What is buyer 2's relationship to buyer 1?"
+ person:
+ page_header: ""
+ check_answer_label: "Person 2’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 2’s relationship to Buyer 1?"
+
+ age2:
+ buyer:
+ page_header: ""
+ age2_known:
+ check_answer_label: "Buyer 2’s age"
+ hint_text: ""
+ question_text: "Do you know buyer 2’s age?"
+ age2:
+ check_answer_label: "Buyer 2’s age"
+ hint_text: ""
+ question_text: "Age"
+ person:
+ page_header: ""
+ age2_known:
+ check_answer_label: "Person 2’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 2’s age?"
+ age:
+ check_answer_label: "Person 2’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex2:
+ buyer:
+ page_header: ""
+ check_answer_label: "Buyer 2’s gender identity"
+ hint_text: ""
+ question_text: "Which of these best describes buyer 2’s gender identity?"
+ person:
+ page_header: ""
+ check_answer_label: "Person 2’s gender identity"
+ hint_text: ""
+ question_text: "Which of these best describes Person 2’s gender identity?"
+
+ ethnic_group2:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic group"
+ hint_text: ""
+ question_text: "What is buyer 2’s ethnic group?"
+
+ ethnicbuy2:
+ ethnic_background_black:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
+ ethnic_background_asian:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?"
+ ethnic_background_arab:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Arab background?"
+ ethnic_background_mixed:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
+ ethnic_background_white:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s White background?"
+
+ nationalbuy2:
+ page_header: ""
+ check_answer_label: "Buyer 2’s nationality"
+ hint_text: ""
+ question_text: "What is buyer 2’s nationality?"
+
+ ecstat2:
+ buyer:
+ page_header: ""
+ check_answer_label: "Buyer 2's working situation"
+ hint_text: ""
+ question_text: "Which of these best describes buyer 2's working situation?"
+ person:
+ page_header: ""
+ check_answer_label: "Person 2’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 2’s working situation?"
+
+ buy2livein:
+ page_header: ""
+ check_answer_label: "Will buyer 2 live in the property?"
+ hint_text: ""
+ question_text: "Will buyer 2 live in the property?"
+
+ hholdcount:
+ joint_purchase:
+ page_header: ""
+ check_answer_label: "Number of other people living in the property"
+ hint_text: "You can provide details for a maximum of 4 other people for a joint purchase."
+ question_text: "Besides the buyers, how many other people live or will live in the property?"
+ not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Number of other people living in the property"
+ hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer."
+ question_text: "Besides the buyer, how many other people live or will live in the property?"
+
+ details_known_2:
+ page_header: ""
+ check_answer_label: "Details known for person 2?"
+ hint_text: ""
+ question_text: "Do you know the details for person 2?"
+
+ details_known_3:
+ page_header: ""
+ check_answer_label: "Details known for person 3?"
+ hint_text: ""
+ question_text: "Do you know the details for person 3?"
+
+ relat3:
+ page_header: ""
+ check_answer_label: "Person 3’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 3’s relationship to Buyer 1?"
+
+ age3:
+ page_header: ""
+ age3_known:
+ check_answer_label: "Person 3’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 3’s age?"
+ age3:
+ check_answer_label: "Person 3’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex3:
+ page_header: ""
+ check_answer_label: "Person 3’s gender identity"
+ hint_text: ""
+ question_text: "Which of these best describes Person 3’s gender identity?"
+
+ ecstat3:
+ page_header: ""
+ check_answer_label: "Person 3’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 3’s working situation?"
+
+ details_known_4:
+ page_header: ""
+ check_answer_label: "Details known for person 4?"
+ hint_text: ""
+ question_text: "Do you know the details for person 4?"
+
+ relat4:
+ page_header: ""
+ check_answer_label: "Person 4’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 4’s relationship to Buyer 1?"
+
+ age4:
+ page_header: ""
+ age4_known:
+ check_answer_label: "Person 4’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 4’s age?"
+ age4:
+ check_answer_label: "Person 4’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex4:
+ page_header: ""
+ check_answer_label: "Person 4’s gender identity"
+ hint_text: ""
+ question_text: "Which of these best describes Person 4’s gender identity?"
+
+ ecstat4:
+ page_header: ""
+ check_answer_label: "Person 4’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 4’s working situation?"
+
+ details_known_5:
+ page_header: ""
+ check_answer_label: "Details known for person 5?"
+ hint_text: ""
+ question_text: "Do you know the details for person 5?"
+
+ relat5:
+ page_header: ""
+ check_answer_label: "Person 5’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 5’s relationship to Buyer 1?"
+
+ age5:
+ page_header: ""
+ age5_known:
+ check_answer_label: "Person 5’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 5’s age?"
+ age5:
+ check_answer_label: "Person 5’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex5:
+ page_header: ""
+ check_answer_label: "Person 5’s gender identity"
+ hint_text: ""
+ question_text: "Which of these best describes Person 5’s gender identity?"
+
+ ecstat5:
+ page_header: ""
+ check_answer_label: "Person 5’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 5’s working situation?"
+
+ details_known_6:
+ page_header: ""
+ check_answer_label: "Details known for person 6?"
+ hint_text: ""
+ question_text: "Do you know the details for person 6?"
+
+ relat6:
+ page_header: ""
+ check_answer_label: "Person 6’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 6’s relationship to Buyer 1?"
+
+ age6:
+ page_header: ""
+ age6_known:
+ check_answer_label: "Person 6’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 6’s age?"
+ age6:
+ check_answer_label: "Person 6’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex6:
+ page_header: ""
+ check_answer_label: "Person 6’s gender identity"
+ hint_text: ""
+ question_text: "Which of these best describes Person 6’s gender identity?"
+
+ ecstat6:
+ page_header: ""
+ check_answer_label: "Person 6’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 6’s working situation?"
diff --git a/config/locales/forms/2023/sales/household_needs.en.yml b/config/locales/forms/2023/sales/household_needs.en.yml
new file mode 100644
index 000000000..f4a13e47a
--- /dev/null
+++ b/config/locales/forms/2023/sales/household_needs.en.yml
@@ -0,0 +1,34 @@
+en:
+ forms:
+ 2023:
+ sales:
+ household_needs:
+ hhregres:
+ page_header: ""
+ check_answer_label: "Have any of the buyers ever served as a regular in the UK armed forces?"
+ hint_text: "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"
+ question_text: "Have any of the buyers ever served as a regular in the UK armed forces?"
+
+ hhregresstill:
+ page_header: ""
+ check_answer_label: "Are they still serving in the UK armed forces?"
+ hint_text: ""
+ question_text: "Is the buyer still serving in the UK armed forces?"
+
+ armedforcesspouse:
+ page_header: ""
+ check_answer_label: "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?"
+ hint_text: ""
+ question_text: "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?"
+
+ disabled:
+ page_header: ""
+ check_answer_label: "Does anyone in the household have a disability?"
+ hint_text: "This includes any long-term health condition that has an impact on the person's day-to-day life"
+ question_text: "Does anyone in the household consider themselves to have a disability?"
+
+ wheel:
+ page_header: ""
+ check_answer_label: "Does anyone in the household use a wheelchair?"
+ hint_text: "This can be inside or outside the home"
+ question_text: "Does anyone in the household use a wheelchair?"
diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml
index de5138208..3467b9432 100644
--- a/config/locales/forms/2023/sales/soft_validations.en.yml
+++ b/config/locales/forms/2023/sales/soft_validations.en.yml
@@ -3,25 +3,51 @@ en:
2023:
sales:
soft_validations:
- income1_value_check:
+ retirement_value_check:
+ max:
+ page_header: ""
+ check_answer_label: "Retirement confirmation"
+ hint_text: ""
+ question_text: "Are you sure this person isn't retired?"
+ title_text: "You told us this person is over 66 and not retired."
+ informative_text: "The minimum expected retirement age in England is 66."
+ min:
+ page_header: ""
+ check_answer_label: "Retirement confirmation"
+ hint_text: ""
+ question_text: "Are you sure this person is retired?"
+ title_text: "You told us this person is aged %{age} years and retired."
+ informative_text: "The minimum expected retirement age in England is 66."
+ old_persons_shared_ownership_value_check:
page_header: ""
+ check_answer_label: "Shared ownership confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text:
+ joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme."
+ not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme."
+ informative_text: "At least one buyer must be aged 65 years and over to use this scheme."
+ income1_value_check:
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
min:
+ page_header: ""
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
+ page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. 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?"
min:
+ page_header: ""
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
+ page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
combined_income_value_check:
page_header: ""
@@ -58,3 +84,45 @@ en:
not_joint_purchase:
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
+ wheel_value_check:
+ page_header: ""
+ check_answer_label: "Does anyone in the household use a wheelchair?"
+ hint_text: ""
+ question_text: "You told us that someone in the household uses a wheelchair."
+ title_text: "You told us that someone in the household uses a wheelchair."
+ buyer_livein_value_check:
+ buyer1:
+ page_header: ""
+ check_answer_label: "Buyer live in confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that buyer 1 will not live in the property."
+ informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
+ buyer2:
+ page_header: ""
+ check_answer_label: "Buyer live in confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that buyer 2 will not live in the property."
+ informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
+ student_not_child_value_check:
+ page_header: ""
+ check_answer_label: "Student not a child confirmation"
+ hint_text: ""
+ question_text: "Are you sure this person is not a child?"
+ title_text: "You told us this person is a student aged between 16 and 19."
+ informative_text: "Are you sure this person is not a child?"
+ partner_under_16_value_check:
+ page_header: ""
+ check_answer_label: "Partner under 16 confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
+ informative_text: "Are you sure this is correct?"
+ multiple_partners_value_check:
+ page_header: ""
+ check_answer_label: "Multiple partners confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
+ informative_text: "Are you sure this is correct?"
diff --git a/config/locales/forms/2024/sales/household_characteristics.en.yml b/config/locales/forms/2024/sales/household_characteristics.en.yml
new file mode 100644
index 000000000..22f9427e8
--- /dev/null
+++ b/config/locales/forms/2024/sales/household_characteristics.en.yml
@@ -0,0 +1,345 @@
+en:
+ forms:
+ 2024:
+ sales:
+ household_characteristics:
+ age1:
+ page_header: ""
+ age1_known:
+ check_answer_label: "Buyer 1’s age"
+ hint_text: "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."
+ question_text: "Do you know buyer 1’s age?"
+ age1:
+ check_answer_label: "Buyer 1’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex1:
+ page_header: ""
+ check_answer_label: "Buyer 1’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes buyer 1’s gender identity?"
+
+ ethnic_group:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic group"
+ hint_text: ""
+ question_text: "What is buyer 1’s ethnic group?"
+
+ ethnic:
+ ethnic_background_black:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
+ ethnic_background_asian:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?"
+ ethnic_background_arab:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 1’s Arab background?"
+ ethnic_background_mixed:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
+ ethnic_background_white:
+ page_header: ""
+ check_answer_label: "Buyer 1’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 1’s White background?"
+
+ nationality_all_group:
+ page_header: ""
+ check_answer_label: "Buyer 1’s nationality"
+ hint_text: "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."
+ question_text: "What is buyer 1’s nationality?"
+
+ nationality_all:
+ page_header: ""
+ check_answer_label: "Buyer 1’s nationality"
+ hint_text: ""
+ question_text: "Enter a nationality"
+
+ ecstat1:
+ page_header: ""
+ check_answer_label: "Buyer 1's working situation"
+ hint_text: ""
+ question_text: "Which of these best describes buyer 1's working situation?"
+
+ buy1livein:
+ page_header: ""
+ check_answer_label: "Will buyer 1 live in the property?"
+ hint_text: ""
+ question_text: "Will buyer 1 live in the property?"
+
+ relat2:
+ buyer:
+ page_header: ""
+ check_answer_label: "Buyer 2's relationship to buyer 1"
+ hint_text: ""
+ question_text: "What is buyer 2's relationship to buyer 1?"
+ person:
+ page_header: ""
+ check_answer_label: "Person 2’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 2’s relationship to Buyer 1?"
+
+ age2:
+ buyer:
+ page_header: ""
+ age2_known:
+ check_answer_label: "Buyer 2’s age"
+ hint_text: ""
+ question_text: "Do you know buyer 2’s age?"
+ age2:
+ check_answer_label: "Buyer 2’s age"
+ hint_text: ""
+ question_text: "Age"
+ person:
+ page_header: ""
+ age2_known:
+ check_answer_label: "Person 2’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 2’s age?"
+ age2:
+ check_answer_label: "Person 2’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex2:
+ buyer:
+ page_header: ""
+ check_answer_label: "Buyer 2’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes buyer 2’s gender identity?"
+ person:
+ page_header: ""
+ check_answer_label: "Person 2’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes Person 2’s gender identity?"
+
+ ethnic_group2:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic group"
+ hint_text: ""
+ question_text: "What is buyer 2’s ethnic group?"
+
+ ethnicbuy2:
+ ethnic_background_black:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
+ ethnic_background_asian:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?"
+ ethnic_background_arab:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Arab background?"
+ ethnic_background_mixed:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
+ ethnic_background_white:
+ page_header: ""
+ check_answer_label: "Buyer 2’s ethnic background"
+ hint_text: ""
+ question_text: "Which of the following best describes buyer 2’s White background?"
+
+ nationality_all_buyer2_group:
+ page_header: ""
+ check_answer_label: "Buyer 2’s nationality"
+ hint_text: "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."
+ question_text: "What is buyer 2’s nationality?"
+
+ nationality_all_buyer2:
+ page_header: ""
+ check_answer_label: "Buyer 2’s nationality"
+ hint_text: ""
+ question_text: "Enter a nationality"
+
+ ecstat2:
+ buyer:
+ page_header: ""
+ check_answer_label: "Buyer 2's working situation"
+ hint_text: ""
+ question_text: "Which of these best describes buyer 2's working situation?"
+ person:
+ page_header: ""
+ check_answer_label: "Person 2’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 2’s working situation?"
+
+ buy2livein:
+ page_header: ""
+ check_answer_label: "Will buyer 2 live in the property?"
+ hint_text: ""
+ question_text: "Will buyer 2 live in the property?"
+
+ hholdcount:
+ joint_purchase:
+ page_header: ""
+ check_answer_label: "Number of other people living in the property"
+ hint_text: "You can provide details for a maximum of 4 other people for a joint purchase."
+ question_text: "Besides the buyers, how many other people live or will live in the property?"
+ not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Number of other people living in the property"
+ hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer."
+ question_text: "Besides the buyer, how many other people live or will live in the property?"
+
+ details_known_2:
+ page_header: ""
+ check_answer_label: "Details known for person 2?"
+ hint_text: ""
+ question_text: "Do you know the details for person 2?"
+
+ details_known_3:
+ page_header: ""
+ check_answer_label: "Details known for person 3?"
+ hint_text: ""
+ question_text: "Do you know the details for person 3?"
+
+ relat3:
+ page_header: ""
+ check_answer_label: "Person 3’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 3’s relationship to Buyer 1?"
+
+ age3:
+ page_header: ""
+ age3_known:
+ check_answer_label: "Person 3’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 3’s age?"
+ age3:
+ check_answer_label: "Person 3’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex3:
+ page_header: ""
+ check_answer_label: "Person 3’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes Person 3’s gender identity?"
+
+ ecstat3:
+ page_header: ""
+ check_answer_label: "Person 3’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 3’s working situation?"
+
+ details_known_4:
+ page_header: ""
+ check_answer_label: "Details known for person 4?"
+ hint_text: ""
+ question_text: "Do you know the details for person 4?"
+
+ relat4:
+ page_header: ""
+ check_answer_label: "Person 4’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 4’s relationship to Buyer 1?"
+
+ age4:
+ page_header: ""
+ age4_known:
+ check_answer_label: "Person 4’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 4’s age?"
+ age4:
+ check_answer_label: "Person 4’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex4:
+ page_header: ""
+ check_answer_label: "Person 4’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes Person 4’s gender identity?"
+
+ ecstat4:
+ page_header: ""
+ check_answer_label: "Person 4’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 4’s working situation?"
+
+ details_known_5:
+ page_header: ""
+ check_answer_label: "Details known for person 5?"
+ hint_text: ""
+ question_text: "Do you know the details for person 5?"
+
+ relat5:
+ page_header: ""
+ check_answer_label: "Person 5’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 5’s relationship to Buyer 1?"
+
+ age5:
+ page_header: ""
+ age5_known:
+ check_answer_label: "Person 5’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 5’s age?"
+ age5:
+ check_answer_label: "Person 5’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex5:
+ page_header: ""
+ check_answer_label: "Person 5’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes Person 5’s gender identity?"
+
+ ecstat5:
+ page_header: ""
+ check_answer_label: "Person 5’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 5’s working situation?"
+
+ details_known_6:
+ page_header: ""
+ check_answer_label: "Details known for person 6?"
+ hint_text: ""
+ question_text: "Do you know the details for person 6?"
+
+ relat6:
+ page_header: ""
+ check_answer_label: "Person 6’s relationship to Buyer 1"
+ hint_text: ""
+ question_text: "What is Person 6’s relationship to Buyer 1?"
+
+ age6:
+ page_header: ""
+ age6_known:
+ check_answer_label: "Person 6’s age known?"
+ hint_text: ""
+ question_text: "Do you know person 6’s age?"
+ age6:
+ check_answer_label: "Person 6’s age"
+ hint_text: ""
+ question_text: "Age"
+
+ sex6:
+ page_header: ""
+ check_answer_label: "Person 6’s gender identity"
+ hint_text: "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."
+ question_text: "Which of these best describes Person 6’s gender identity?"
+
+ ecstat6:
+ page_header: ""
+ check_answer_label: "Person 6’s working situation"
+ hint_text: ""
+ question_text: "Which of these best describes Person 6’s working situation?"
diff --git a/config/locales/forms/2024/sales/household_needs.en.yml b/config/locales/forms/2024/sales/household_needs.en.yml
new file mode 100644
index 000000000..290543a34
--- /dev/null
+++ b/config/locales/forms/2024/sales/household_needs.en.yml
@@ -0,0 +1,34 @@
+en:
+ forms:
+ 2024:
+ sales:
+ household_needs:
+ hhregres:
+ page_header: ""
+ check_answer_label: "Have any of the buyers ever served as a regular in the UK armed forces?"
+ hint_text: "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"
+ question_text: "Have any of the buyers ever served as a regular in the UK armed forces?"
+
+ hhregresstill:
+ page_header: ""
+ check_answer_label: "Are they still serving in the UK armed forces?"
+ hint_text: ""
+ question_text: "Is the buyer still serving in the UK armed forces?"
+
+ armedforcesspouse:
+ page_header: ""
+ check_answer_label: "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?"
+ hint_text: ""
+ question_text: "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?"
+
+ disabled:
+ page_header: ""
+ check_answer_label: "Does anyone in the household have a disability?"
+ hint_text: "This includes any long-term health condition that has an impact on the person's day-to-day life"
+ question_text: "Does anyone in the household consider themselves to have a disability?"
+
+ wheel:
+ page_header: ""
+ check_answer_label: "Does anyone in the household use a wheelchair?"
+ hint_text: "This can be inside or outside the home"
+ question_text: "Does anyone in the household use a wheelchair?"
diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml
index 853d21ad2..39af6cb38 100644
--- a/config/locales/forms/2024/sales/soft_validations.en.yml
+++ b/config/locales/forms/2024/sales/soft_validations.en.yml
@@ -3,25 +3,51 @@ en:
2024:
sales:
soft_validations:
- income1_value_check:
+ retirement_value_check:
+ max:
+ page_header: ""
+ check_answer_label: "Retirement confirmation"
+ hint_text: ""
+ question_text: "Are you sure this person isn't retired?"
+ title_text: "You told us this person is over 66 and not retired."
+ informative_text: "The minimum expected retirement age in England is 66."
+ min:
+ page_header: ""
+ check_answer_label: "Retirement confirmation"
+ hint_text: ""
+ question_text: "Are you sure this person is retired?"
+ title_text: "You told us this person is aged %{age} years and retired."
+ informative_text: "The minimum expected retirement age in England is 66."
+ old_persons_shared_ownership_value_check:
page_header: ""
+ check_answer_label: "Shared ownership confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text:
+ joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme."
+ not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme."
+ informative_text: "At least one buyer must be aged 65 years and over to use this scheme."
+ income1_value_check:
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
min:
+ page_header: ""
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
+ page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. 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?"
min:
+ page_header: ""
title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation."
max:
+ page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
combined_income_value_check:
page_header: ""
@@ -58,3 +84,45 @@ en:
not_joint_purchase:
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
+ wheel_value_check:
+ page_header: ""
+ check_answer_label: "Does anyone in the household use a wheelchair?"
+ hint_text: ""
+ question_text: "You told us that someone in the household uses a wheelchair."
+ title_text: "You told us that someone in the household uses a wheelchair."
+ buyer_livein_value_check:
+ buyer1:
+ page_header: ""
+ check_answer_label: "Buyer live in confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that buyer 1 will not live in the property."
+ informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
+ buyer2:
+ page_header: ""
+ check_answer_label: "Buyer live in confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that buyer 2 will not live in the property."
+ informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
+ student_not_child_value_check:
+ page_header: ""
+ check_answer_label: "Student not a child confirmation"
+ hint_text: ""
+ question_text: "Are you sure this person is not a child?"
+ title_text: "You told us this person is a student aged between 16 and 19."
+ informative_text: "Are you sure this person is not a child?"
+ partner_under_16_value_check:
+ page_header: ""
+ check_answer_label: "Partner under 16 confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
+ informative_text: "Are you sure this is correct?"
+ multiple_partners_value_check:
+ page_header: ""
+ check_answer_label: "Multiple partners confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
+ informative_text: "Are you sure this is correct?"
diff --git a/config/locales/validations/sales/setup.en.yml b/config/locales/validations/sales/setup.en.yml
index 2741464b0..9dd13b525 100644
--- a/config/locales/validations/sales/setup.en.yml
+++ b/config/locales/validations/sales/setup.en.yml
@@ -7,9 +7,9 @@ en:
next_two_weeks: "Sale completion date must not be later than 14 days from today’s date."
must_be_within:
current_collection_year:
- "Enter a date within the %{current_start_year_short}/%{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
+ "Enter a date within the %{current_start_year_short} to %{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
previous_and_current_collection_year:
- "Enter a date within the %{previous_start_year_short}/%{previous_end_year_short} or %{previous_end_year_short}/%{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
+ "Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
invalid:
merged_organisations:
"Enter a date when the owning organisation was active. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
index 8270007c8..f8962318e 100644
--- a/docs/Gemfile.lock
+++ b/docs/Gemfile.lock
@@ -226,8 +226,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
- rexml (3.3.6)
- strscan
+ rexml (3.3.9)
rouge (3.26.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
@@ -242,7 +241,6 @@ GEM
faraday (>= 0.17.3, < 3)
simpleidn (0.2.1)
unf (~> 0.1.4)
- strscan (3.1.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
typhoeus (1.4.0)
diff --git a/spec/components/bulk_upload_summary_component_spec.rb b/spec/components/bulk_upload_summary_component_spec.rb
index 9c0c68731..544befcb3 100644
--- a/spec/components/bulk_upload_summary_component_spec.rb
+++ b/spec/components/bulk_upload_summary_component_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe BulkUploadSummaryComponent, type: :component do
it "shows the collection year" do
result = render_inline(described_class.new(bulk_upload:))
- expect(result).to have_content("2024/2025")
+ expect(result).to have_content("2024 to 2025")
end
it "includes a download file link" do
diff --git a/spec/features/bulk_upload_lettings_logs_spec.rb b/spec/features/bulk_upload_lettings_logs_spec.rb
index 5d48d9ee0..315e1461e 100644
--- a/spec/features/bulk_upload_lettings_logs_spec.rb
+++ b/spec/features/bulk_upload_lettings_logs_spec.rb
@@ -5,8 +5,7 @@ RSpec.describe "Bulk upload lettings log" do
let(:user) { create(:user) }
let(:current_year) { current_collection_start_year }
- let(:current_formatted_year) { "#{current_year}/#{current_year + 1}" }
- let(:current_formatted_short_year) { "#{current_year}/#{current_year - 2000 + 1}" }
+ let(:current_formatted_year) { "#{current_year} to #{current_year + 1}" }
let(:stub_file_upload) do
vcap_services = { "aws-s3-bucket" => {} }
@@ -47,12 +46,12 @@ RSpec.describe "Bulk upload lettings log" do
expect(page.find_field("form-year-#{current_year}-field")).to be_checked
click_button("Continue")
- expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
+ expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
click_button("Continue")
expect(page).not_to have_content("What is the needs type?")
- expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
+ expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
expect(page).to have_content("Upload your file")
click_button("Upload")
@@ -88,7 +87,7 @@ RSpec.describe "Bulk upload lettings log" do
expect(page).to have_link("Upload lettings logs in bulk")
click_link("Upload lettings logs in bulk")
- expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
+ expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
click_button("Continue")
expect(page).to have_content("Upload your file")
@@ -107,7 +106,7 @@ RSpec.describe "Bulk upload lettings log" do
expect(page).to have_content("Prepare your file")
click_button("Continue")
- expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_short_year})")
+ expect(page).to have_content("Upload lettings logs in bulk (#{current_formatted_year})")
expect(page).to have_content("Upload your file")
click_button("Upload")
diff --git a/spec/features/bulk_upload_sales_logs_spec.rb b/spec/features/bulk_upload_sales_logs_spec.rb
index e47273cdc..b7098999d 100644
--- a/spec/features/bulk_upload_sales_logs_spec.rb
+++ b/spec/features/bulk_upload_sales_logs_spec.rb
@@ -38,7 +38,7 @@ RSpec.describe "Bulk upload sales log" do
click_button("Continue")
expect(page).to have_content("You must select a collection period to upload for")
- choose("2023/2024")
+ choose("2023 to 2024")
click_button("Continue")
click_link("Back")
@@ -46,7 +46,7 @@ RSpec.describe "Bulk upload sales log" do
expect(page.find_field("form-year-2023-field")).to be_checked
click_button("Continue")
- expect(page).to have_content("Upload sales logs in bulk (2023/24)")
+ expect(page).to have_content("Upload sales logs in bulk (2023 to 2024)")
click_button("Continue")
expect(page).to have_content("Upload your file")
@@ -88,7 +88,7 @@ RSpec.describe "Bulk upload sales log" do
expect(page).to have_link("Upload sales logs in bulk")
click_link("Upload sales logs in bulk")
- expect(page).to have_content("Upload sales logs in bulk (2023/24)")
+ expect(page).to have_content("Upload sales logs in bulk (2023 to 2024)")
click_button("Continue")
expect(page).to have_content("Upload your file")
diff --git a/spec/features/sales_log_spec.rb b/spec/features/sales_log_spec.rb
index 8e4ffba42..ceff00f94 100644
--- a/spec/features/sales_log_spec.rb
+++ b/spec/features/sales_log_spec.rb
@@ -191,7 +191,7 @@ RSpec.describe "Sales Log Features" do
context "when one year filter is selected" do
before do
- check("2024")
+ check("2024 to 2025")
click_button("Apply filters")
end
diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb
index 58c82f0c9..b709a16ac 100644
--- a/spec/helpers/filters_helper_spec.rb
+++ b/spec/helpers/filters_helper_spec.rb
@@ -491,7 +491,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
- "2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22"
+ "2023" => "2023 to 2024", "2022" => "2022 to 2023", "2021" => "2021 to 2022"
},
)
end
@@ -505,7 +505,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
- "2023" => "2023/24", "2022" => "2022/23"
+ "2023" => "2023 to 2024", "2022" => "2022 to 2023"
},
)
end
@@ -520,7 +520,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_options).to eq(
{
- "2024" => "2024/25", "2023" => "2023/24", "2022" => "2022/23"
+ "2024" => "2024 to 2025", "2023" => "2023 to 2024", "2022" => "2022 to 2023"
},
)
end
@@ -541,7 +541,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_radio_options).to eq(
{
- "2023" => { label: "2023/24" }, "2022" => { label: "2022/23" }, "2021" => { label: "2021/22" }
+ "2023" => { label: "2023 to 2024" }, "2022" => { label: "2022 to 2023" }, "2021" => { label: "2021 to 2022" }
},
)
end
@@ -555,7 +555,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_radio_options).to eq(
{
- "2023" => { label: "2023/24" }, "2022" => { label: "2022/23" }
+ "2023" => { label: "2023 to 2024" }, "2022" => { label: "2022 to 2023" }
},
)
end
@@ -570,7 +570,7 @@ RSpec.describe FiltersHelper do
it "has the correct options" do
expect(collection_year_radio_options).to eq(
{
- "2024" => { label: "2024/25" }, "2023" => { label: "2023/24" }, "2022" => { label: "2022/23" }
+ "2024" => { label: "2024 to 2025" }, "2023" => { label: "2023 to 2024" }, "2022" => { label: "2022 to 2023" }
},
)
end
diff --git a/spec/helpers/tasklist_helper_spec.rb b/spec/helpers/tasklist_helper_spec.rb
index 5d3bd4f91..c5e1bd784 100644
--- a/spec/helpers/tasklist_helper_spec.rb
+++ b/spec/helpers/tasklist_helper_spec.rb
@@ -143,7 +143,7 @@ RSpec.describe TasklistHelper do
end
it "returns relevant text" do
- expect(review_log_text(sales_log)).to eq("This log is from the 2022/2023 collection window, which is now closed.")
+ expect(review_log_text(sales_log)).to eq("This log is from the 2022 to 2023 collection window, which is now closed.")
end
end
@@ -156,7 +156,7 @@ RSpec.describe TasklistHelper do
end
it "returns relevant text" do
- expect(review_log_text(sales_log)).to eq("This log is from the 2021/2022 collection window, which is now closed.")
+ expect(review_log_text(sales_log)).to eq("This log is from the 2021 to 2022 collection window, which is now closed.")
end
end
end
@@ -186,7 +186,7 @@ RSpec.describe TasklistHelper do
end
it "returns relevant text" do
- expect(review_log_text(lettings_log)).to eq("This log is from the 2022/2023 collection window, which is now closed.")
+ expect(review_log_text(lettings_log)).to eq("This log is from the 2022 to 2023 collection window, which is now closed.")
end
end
@@ -199,7 +199,7 @@ RSpec.describe TasklistHelper do
end
it "returns relevant text" do
- expect(review_log_text(lettings_log)).to eq("This log is from the 2021/2022 collection window, which is now closed.")
+ expect(review_log_text(lettings_log)).to eq("This log is from the 2021 to 2022 collection window, which is now closed.")
end
end
end
diff --git a/spec/models/bulk_upload_spec.rb b/spec/models/bulk_upload_spec.rb
index af2547d7a..db475709a 100644
--- a/spec/models/bulk_upload_spec.rb
+++ b/spec/models/bulk_upload_spec.rb
@@ -39,8 +39,8 @@ RSpec.describe BulkUpload, type: :model do
describe "year_combo" do
[
- { year: 2023, expected_value: "2023/24" },
- { year: 2024, expected_value: "2024/25" },
+ { year: 2023, expected_value: "2023 to 2024" },
+ { year: 2024, expected_value: "2024 to 2025" },
].each do |test_case|
context "when the bulk upload year is #{test_case[:year]}" do
let(:bulk_upload) { build(:bulk_upload, year: test_case[:year]) }
diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb
index ce72974e9..24704526d 100644
--- a/spec/models/form/sales/pages/buyer_interview_spec.rb
+++ b/spec/models/form/sales/pages/buyer_interview_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do
let(:page_id) { "buyer_interview" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) }
+ let(:subsection) { instance_double(Form::Subsection, form:, id: "setup") }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -23,19 +24,43 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model 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) }
+ context "when form is before 2024" do
+ let(:subsection) { instance_double(Form::Subsection, form:, id: "household_characteristics") }
- it "has the expected copy_key" do
- expect(page.copy_key).to eq("sales.setup.noint.joint_purchase")
+ 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.household_characteristics.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.household_characteristics.noint.not_joint_purchase")
+ end
end
end
- context "when there is a single buyer" do
- subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) }
+ context "when form is after 2024" do
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
+
+ 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")
+ it "has the expected copy_key" do
+ expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase")
+ end
end
end
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 4bce29312..72234b6d5 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
@@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do
let(:page_id) { "buyer_1_live_in_value_check" }
let(:page_definition) { nil }
let(:person_index) { 1 }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -34,7 +35,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.buyer1_livein_wrong_for_ownership_type.title_text",
+ "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer1.title_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
})
end
@@ -56,7 +57,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.buyer2_livein_wrong_for_ownership_type.title_text",
+ "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer2.title_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
})
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 f0789b54c..68e269cbf 100644
--- a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb
+++ b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::HouseholdWheelchairCheck, type: :model do
let(:page_id) { "buyer_1_income_mortgage_value_check" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
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 890a24e6a..e3ee322a5 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
@@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 }
let(:page_id) { "multiple_partners_value_check" }
@@ -39,13 +40,13 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.multiple_partners_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text",
"arguments" => [],
})
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -71,13 +72,13 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.multiple_partners_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text",
"arguments" => [],
})
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
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 8bc20cef7..19292db35 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
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m
let(:page_id) { "old_persons_shared_ownership_value_check" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -34,13 +35,13 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.old_persons_shared_ownership.title_text.one",
+ "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.not_joint_purchase",
"arguments" => [],
})
end
it "has the correct informative_text" do
- expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.old_persons_shared_ownership.hint_text" })
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.informative_text" })
end
it "has the correct interruption_screen_question_ids" do
@@ -52,7 +53,7 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.old_persons_shared_ownership.title_text.two",
+ "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.joint_purchase",
"arguments" => [],
})
end
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 fe11bdc86..5785ab900 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
@@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 }
let(:page_id) { "partner_under_16_value_check" }
@@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.partner_under_16_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [
{
"key" => "age1",
@@ -51,7 +52,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.partner_under_16_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [
{
"key" => "age2",
@@ -89,7 +90,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.partner_under_16_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [
{
"key" => "age3",
@@ -127,7 +128,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.partner_under_16_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [
{
"key" => "age4",
@@ -165,7 +166,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.partner_under_16_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [
{
"key" => "age5",
@@ -203,7 +204,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.partner_under_16_sales.title",
+ "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [
{
"key" => "age6",
@@ -241,7 +242,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
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 9185f9f1c..43ba0af49 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
@@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 2 }
let(:page_id) { "person_2_student_not_child_value_check" }
@@ -23,12 +24,12 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.student_not_child.title_text",
+ "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.title_text",
})
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.informative_text" })
end
it "has correct questions" do
diff --git a/spec/models/form/sales/pages/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb
index 1d146f0af..7510e60d9 100644
--- a/spec/models/form/sales/pages/privacy_notice_spec.rb
+++ b/spec/models/form/sales/pages/privacy_notice_spec.rb
@@ -5,12 +5,11 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
let(:page_id) { "privacy_notice" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
- let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, id: "setup") }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) }
before do
allow(subsection).to receive(:form).and_return(form)
- allow(form).to receive(:start_year_after_2024?)
end
it "has correct subsection" do
@@ -32,8 +31,20 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
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.privacynotice.joint_purchase")
+ context "when the form start year is before 2024" do
+ let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") }
+
+ it "has the expected copy_key" do
+ expect(page.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase")
+ end
+ end
+
+ context "when the form start year is after 2024" do
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
+
+ it "has the expected copy_key" do
+ expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
+ end
end
it "has correct depends_on" do
@@ -44,8 +55,20 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
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")
+ context "when the form start year is before 2024" do
+ let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") }
+
+ it "has the expected copy_key" do
+ expect(page.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase")
+ end
+ end
+
+ context "when the form start year is after 2024" do
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
+
+ it "has the expected copy_key" do
+ expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
+ end
end
it "has correct depends_on" do
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 6df7a379b..e316250b5 100644
--- a/spec/models/form/sales/pages/retirement_value_check_spec.rb
+++ b/spec/models/form/sales/pages/retirement_value_check_spec.rb
@@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 }
let(:page_id) { "person_1_retirement_value_check" }
@@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.retirement.min.title",
+ "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [
{
"key" => "age1",
@@ -51,7 +52,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.retirement.min.title",
+ "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [
{
"key" => "age2",
@@ -89,7 +90,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.retirement.min.title",
+ "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [
{
"key" => "age3",
@@ -127,7 +128,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.retirement.min.title",
+ "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [
{
"key" => "age4",
@@ -165,7 +166,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.retirement.min.title",
+ "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [
{
"key" => "age5",
@@ -203,7 +204,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end
it "has correct interruption_screen_question_ids" do
@@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.retirement.min.title",
+ "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [
{
"key" => "age6",
@@ -241,7 +242,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({})
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end
it "has correct interruption_screen_question_ids" do
diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb
index 3370a84f5..e2b39c50f 100644
--- a/spec/models/form/sales/questions/buyer_interview_spec.rb
+++ b/spec/models/form/sales/questions/buyer_interview_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do
let(:question_id) { nil }
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)))) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: true) }
+ let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "setup")) }
it "has correct page" do
expect(question.page).to eq(page)
@@ -33,16 +34,42 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do
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")
+ context "when the form start year is before 2024" do
+ let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 3, 1), start_year_after_2024?: false) }
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.household_characteristics.noint.joint_purchase")
+ end
+ end
+
+ context "when the form start year is after 2024" do
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.setup.noint.joint_purchase")
+ end
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")
+ context "when the form start year is before 2024" do
+ let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) }
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase")
+ end
+ end
+
+ context "when the form start year is after 2024" do
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase")
+ end
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 11589049d..48de6056f 100644
--- a/spec/models/form/sales/questions/privacy_notice_spec.rb
+++ b/spec/models/form/sales/questions/privacy_notice_spec.rb
@@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:subsection) { instance_double(Form::Subsection, id: "setup") }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do
@@ -31,23 +31,9 @@ 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
+ let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") }
+
before do
allow(form).to receive(:start_year_after_2024?).and_return(false)
end
@@ -66,6 +52,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyer before you can submit this log.")
end
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase")
+ end
end
context "and there are joint buyers" do
@@ -84,6 +74,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyers before you can submit this log.")
end
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase")
+ end
end
end
@@ -106,6 +100,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show or give the buyer access to the MHCLG privacy notice before you can submit this log.")
end
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
+ end
end
context "and there are joint buyers" do
@@ -124,6 +122,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show or give the buyers access to the MHCLG privacy notice before you can submit this log.")
end
+
+ it "has the expected copy_key" do
+ expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
+ end
end
end
end
diff --git a/spec/models/form/sales/subsections/household_needs_spec.rb b/spec/models/form/sales/subsections/household_needs_spec.rb
index d65f5513e..cd4ff67fa 100644
--- a/spec/models/form/sales/subsections/household_needs_spec.rb
+++ b/spec/models/form/sales/subsections/household_needs_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Subsections::HouseholdNeeds, type: :model do
let(:subsection_id) { nil }
let(:subsection_definition) { nil }
- let(:section) { instance_double(Form::Sales::Sections::Household) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:section) { instance_double(Form::Sales::Sections::Household, form:) }
it "has correct section" do
expect(household_characteristics.section).to eq(section)
diff --git a/spec/models/forms/bulk_upload_lettings/year_spec.rb b/spec/models/forms/bulk_upload_lettings/year_spec.rb
index 70d6af4bf..c4429b98b 100644
--- a/spec/models/forms/bulk_upload_lettings/year_spec.rb
+++ b/spec/models/forms/bulk_upload_lettings/year_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe Forms::BulkUploadLettings::Year do
it "returns current and previous years" do
expect(form.options.map(&:id)).to eql([2024, 2023])
- expect(form.options.map(&:name)).to eql(%w[2024/2025 2023/2024])
+ expect(form.options.map(&:name)).to eql(["2024 to 2025", "2023 to 2024"])
end
end
@@ -28,7 +28,7 @@ RSpec.describe Forms::BulkUploadLettings::Year do
it "returns the current year" do
expect(form.options.map(&:id)).to eql([2024])
- expect(form.options.map(&:name)).to eql(%w[2024/2025])
+ expect(form.options.map(&:name)).to eql(["2024 to 2025"])
end
end
@@ -40,7 +40,7 @@ RSpec.describe Forms::BulkUploadLettings::Year do
it "returns current and next years" do
expect(form.options.map(&:id)).to eql([2024, 2025])
- expect(form.options.map(&:name)).to eql(%w[2024/2025 2025/2026])
+ expect(form.options.map(&:name)).to eql(["2024 to 2025", "2025 to 2026"])
end
end
end
diff --git a/spec/models/forms/bulk_upload_sales/year_spec.rb b/spec/models/forms/bulk_upload_sales/year_spec.rb
index 2cfa8babc..b1b22bb8d 100644
--- a/spec/models/forms/bulk_upload_sales/year_spec.rb
+++ b/spec/models/forms/bulk_upload_sales/year_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe Forms::BulkUploadSales::Year do
it "returns current and previous years" do
expect(form.options.map(&:id)).to eql([2024, 2023])
- expect(form.options.map(&:name)).to eql(%w[2024/2025 2023/2024])
+ expect(form.options.map(&:name)).to eql(["2024 to 2025", "2023 to 2024"])
end
end
@@ -28,7 +28,7 @@ RSpec.describe Forms::BulkUploadSales::Year do
it "returns the current year" do
expect(form.options.map(&:id)).to eql([2024])
- expect(form.options.map(&:name)).to eql(%w[2024/2025])
+ expect(form.options.map(&:name)).to eql(["2024 to 2025"])
end
end
@@ -44,7 +44,7 @@ RSpec.describe Forms::BulkUploadSales::Year do
it "returns current and next years" do
expect(form.options.map(&:id)).to eql([2024, 2025])
- expect(form.options.map(&:name)).to eql(%w[2024/2025 2025/2026])
+ expect(form.options.map(&:name)).to eql(["2024 to 2025", "2025 to 2026"])
end
end
end
diff --git a/spec/models/validations/sales/setup_validations_spec.rb b/spec/models/validations/sales/setup_validations_spec.rb
index 797b0c22c..659cde23f 100644
--- a/spec/models/validations/sales/setup_validations_spec.rb
+++ b/spec/models/validations/sales/setup_validations_spec.rb
@@ -37,7 +37,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors[:saledate]).to include(/Enter a date within the \d{2}\/\d{2} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
+ expect(record.errors[:saledate]).to include(/Enter a date within the \d{4} to \d{4} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
end
end
@@ -47,7 +47,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors[:saledate]).to include(/Enter a date within the \d{2}\/\d{2} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
+ expect(record.errors[:saledate]).to include(/Enter a date within the \d{4} to \d{4} collection year, which is between 1st April \d{4} and 31st March \d{4}/)
end
end
end
@@ -91,7 +91,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors[:saledate]).to include("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
+ expect(record.errors[:saledate]).to include("Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
@@ -105,7 +105,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "adds error" do
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors[:saledate]).to include("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
+ expect(record.errors[:saledate]).to include("Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
@@ -119,7 +119,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it "cannot create new logs for the archived collection year" do
record.saledate = Time.zone.local(2023, 1, 1)
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors["saledate"]).to include(match "Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
+ expect(record.errors["saledate"]).to include(match "Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
it "can edit already created logs for the previous collection year" do
@@ -127,7 +127,7 @@ RSpec.describe Validations::Sales::SetupValidations do
record.save!(validate: false)
record.saledate = Time.zone.local(2024, 1, 1)
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors["saledate"]).not_to include(match "Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025.")
+ expect(record.errors["saledate"]).not_to include(match "Enter a date within the 2024 to 2025 collection year, which is between 1st April 2024 and 31st March 2025.")
end
end
@@ -142,7 +142,7 @@ RSpec.describe Validations::Sales::SetupValidations do
record.update!(saledate: nil)
record.saledate = Time.zone.local(2023, 1, 1)
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors["saledate"]).to include(match "Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
+ expect(record.errors["saledate"]).to include(match "Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
it "cannot edit already created logs for the archived collection year" do
@@ -150,7 +150,7 @@ RSpec.describe Validations::Sales::SetupValidations do
record.save!(validate: false)
record.saledate = Time.zone.local(2023, 1, 1)
setup_validator.validate_saledate_collection_year(record)
- expect(record.errors["saledate"]).to include(match "Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
+ expect(record.errors["saledate"]).to include(match "Enter a date within the 2023 to 2024 or 2024 to 2025 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
end
diff --git a/spec/models/validations/setup_validations_spec.rb b/spec/models/validations/setup_validations_spec.rb
index f39b71328..f1e306a89 100644
--- a/spec/models/validations/setup_validations_spec.rb
+++ b/spec/models/validations/setup_validations_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe Validations::SetupValidations do
let(:record) { build(:lettings_log) }
describe "tenancy start date" do
- context "when in 22/23 collection" do
+ context "when in 2022 to 2023 collection" do
context "when in the crossover period" do
before do
allow(Time).to receive(:now).and_return(Time.zone.local(2022, 4, 1))
@@ -18,14 +18,14 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2021, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2021 to 2022 or 2022 to 2023 collection years, which is between 1st April 2021 and 31st March 2023")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2023, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2021 to 2022 or 2022 to 2023 collection years, which is between 1st April 2021 and 31st March 2023")
end
end
@@ -39,19 +39,19 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2022, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 collection year, which is between 1st April 2022 and 31st March 2023")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2023, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 collection year, which is between 1st April 2022 and 31st March 2023")
end
end
end
- context "when in 23/24 collection" do
+ context "when in 2023 to 2024 collection" do
context "when in the crossover period" do
before do
allow(Time).to receive(:now).and_return(Time.zone.local(2023, 4, 1))
@@ -62,14 +62,14 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2022, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 or 2023 to 2024 collection years, which is between 1st April 2022 and 31st March 2024")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2024, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2022 to 2023 or 2023 to 2024 collection years, which is between 1st April 2022 and 31st March 2024")
end
end
@@ -83,14 +83,14 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
it "cannot be after the second collection window end date" do
record.startdate = Time.zone.local(2024, 7, 1, 6)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
@@ -104,7 +104,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
xit "can edit already created logs for the previous collection year" do
@@ -113,7 +113,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).not_to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
+ expect(record.errors["startdate"]).not_to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
@@ -127,7 +127,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
it "cannot edit already created logs for the previous collection year" do
@@ -136,7 +136,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2023, 1, 1)
setup_validator.validate_startdate_setup(record)
setup_validator.validate_merged_organisations_start_date(record)
- expect(record.errors["startdate"]).to include(match "Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
+ expect(record.errors["startdate"]).to include(match "Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
end
@@ -157,7 +157,7 @@ RSpec.describe Validations::SetupValidations do
record.startdate = Time.zone.local(2024, 4, 1)
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"].length).to be >= 2
- expect(record.errors["startdate"][0]).to eq("Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024.")
+ expect(record.errors["startdate"][0]).to eq("Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024.")
expect(record.errors["startdate"][1]).to eq(I18n.t("validations.setup.startdate.later_than_14_days_after"))
end
end
diff --git a/spec/requests/bulk_upload_lettings_results_controller_spec.rb b/spec/requests/bulk_upload_lettings_results_controller_spec.rb
index dc78c9d78..afbd84df9 100644
--- a/spec/requests/bulk_upload_lettings_results_controller_spec.rb
+++ b/spec/requests/bulk_upload_lettings_results_controller_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe BulkUploadLettingsResultsController, type: :request do
get "/lettings-logs/bulk-upload-results/#{bulk_upload.id}/summary"
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for lettings (#{bulk_upload.year_combo})")
+ expect(response.body).to include("Upload lettings logs in bulk (#{bulk_upload.year_combo})")
end
it "renders the bulk upload filename" do
@@ -90,7 +90,7 @@ RSpec.describe BulkUploadLettingsResultsController, type: :request do
get "/lettings-logs/bulk-upload-results/#{bulk_upload.id}"
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for lettings (#{bulk_upload.year_combo})")
+ expect(response.body).to include("Upload lettings logs in bulk (#{bulk_upload.year_combo})")
end
it "renders correct number of errors" do
diff --git a/spec/requests/bulk_upload_lettings_resume_controller_spec.rb b/spec/requests/bulk_upload_lettings_resume_controller_spec.rb
index f6ac9bb4a..8e3c0b0e0 100644
--- a/spec/requests/bulk_upload_lettings_resume_controller_spec.rb
+++ b/spec/requests/bulk_upload_lettings_resume_controller_spec.rb
@@ -60,7 +60,7 @@ RSpec.describe BulkUploadLettingsResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for lettings")
+ expect(response.body).to include("Upload lettings logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("View the error report")
expect(response.body).to include("How would you like to fix the errors?")
@@ -120,7 +120,7 @@ RSpec.describe BulkUploadLettingsResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for lettings")
+ expect(response.body).to include("Upload lettings logs in bulk")
expect(response.body).to include("Cancel")
end
end
@@ -218,7 +218,7 @@ RSpec.describe BulkUploadLettingsResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for lettings")
+ expect(response.body).to include("Upload lettings logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("These 2 answers will be deleted if you upload the log")
expect(response.body).to include(bulk_upload.filename)
@@ -260,7 +260,7 @@ RSpec.describe BulkUploadLettingsResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for lettings")
+ expect(response.body).to include("Upload lettings logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("These 2 answers will be deleted if you upload the log")
expect(response.body).to include(bulk_upload.filename)
diff --git a/spec/requests/bulk_upload_lettings_soft_validations_check_controller_spec.rb b/spec/requests/bulk_upload_lettings_soft_validations_check_controller_spec.rb
index e7fc9ed46..315235e0e 100644
--- a/spec/requests/bulk_upload_lettings_soft_validations_check_controller_spec.rb
+++ b/spec/requests/bulk_upload_lettings_soft_validations_check_controller_spec.rb
@@ -14,7 +14,7 @@ RSpec.describe BulkUploadLettingsSoftValidationsCheckController, type: :request
it "shows the soft validation errors with confirmation question" do
get "/lettings-logs/bulk-upload-soft-validations-check/#{bulk_upload.id}/confirm-soft-errors"
- expect(response.body).to include("Bulk upload for lettings")
+ expect(response.body).to include("Upload lettings logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("Check these 2 answers")
expect(response.body).to include(bulk_upload.filename)
diff --git a/spec/requests/bulk_upload_sales_results_controller_spec.rb b/spec/requests/bulk_upload_sales_results_controller_spec.rb
index 1bd171dec..b7bb7a10c 100644
--- a/spec/requests/bulk_upload_sales_results_controller_spec.rb
+++ b/spec/requests/bulk_upload_sales_results_controller_spec.rb
@@ -52,7 +52,7 @@ RSpec.describe BulkUploadSalesResultsController, type: :request do
get "/sales-logs/bulk-upload-results/#{bulk_upload.id}"
expect(response).to be_successful
- expect(response.body).to include("Bulk Upload for sales (#{bulk_upload.year_combo})")
+ expect(response.body).to include("Upload sales logs in bulk (#{bulk_upload.year_combo})")
end
it "renders correct number of errors" do
diff --git a/spec/requests/bulk_upload_sales_resume_controller_spec.rb b/spec/requests/bulk_upload_sales_resume_controller_spec.rb
index 9c0efded8..c6622afcb 100644
--- a/spec/requests/bulk_upload_sales_resume_controller_spec.rb
+++ b/spec/requests/bulk_upload_sales_resume_controller_spec.rb
@@ -60,7 +60,7 @@ RSpec.describe BulkUploadSalesResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for sales")
+ expect(response.body).to include("Upload sales logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("View the error report")
expect(response.body).to include("How would you like to fix the errors?")
@@ -120,7 +120,7 @@ RSpec.describe BulkUploadSalesResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for sales")
+ expect(response.body).to include("Upload sales logs in bulk")
expect(response.body).to include("Cancel")
end
end
@@ -218,7 +218,7 @@ RSpec.describe BulkUploadSalesResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for sales")
+ expect(response.body).to include("Upload sales logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("These 2 answers will be deleted if you upload the log")
expect(response.body).to include(bulk_upload.filename)
@@ -260,7 +260,7 @@ RSpec.describe BulkUploadSalesResumeController, type: :request do
expect(response).to be_successful
- expect(response.body).to include("Bulk upload for sales")
+ expect(response.body).to include("Upload sales logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("These 2 answers will be deleted if you upload the log")
expect(response.body).to include(bulk_upload.filename)
diff --git a/spec/requests/bulk_upload_sales_soft_validations_check_controller_spec.rb b/spec/requests/bulk_upload_sales_soft_validations_check_controller_spec.rb
index f22ca0aa2..90e44a4f7 100644
--- a/spec/requests/bulk_upload_sales_soft_validations_check_controller_spec.rb
+++ b/spec/requests/bulk_upload_sales_soft_validations_check_controller_spec.rb
@@ -14,7 +14,7 @@ RSpec.describe BulkUploadSalesSoftValidationsCheckController, type: :request do
it "shows the soft validation errors with confirmation question" do
get "/sales-logs/bulk-upload-soft-validations-check/#{bulk_upload.id}/confirm-soft-errors"
- expect(response.body).to include("Bulk upload for sales")
+ expect(response.body).to include("Upload sales logs in bulk")
expect(response.body).to include(bulk_upload.year_combo)
expect(response.body).to include("Check these 2 answers")
expect(response.body).to include(bulk_upload.filename)
diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb
index 03308238b..308b90c1e 100644
--- a/spec/requests/lettings_logs_controller_spec.rb
+++ b/spec/requests/lettings_logs_controller_spec.rb
@@ -1158,6 +1158,31 @@ RSpec.describe LettingsLogsController, type: :request do
expect(page).to have_link("review and make changes to this log", href: "/lettings-logs/#{lettings_log.id}/review")
end
end
+
+ context "with bulk_upload_id filter" do
+ let(:bulk_upload) { create(:bulk_upload, :lettings, user:) }
+ let(:lettings_log) { create(:lettings_log, :completed, age1: nil, bulk_upload:, assigned_to: user, creation_method: "bulk upload") }
+
+ before do
+ lettings_log.status = "completed"
+ lettings_log.skip_update_status = true
+ lettings_log.save!(validate: false)
+ end
+
+ context "with bulk_upload_id filter in session" do
+ it "displays back to uploaded logs link" do
+ get "/lettings-logs/#{lettings_log.id}?bulk_upload_id[]=#{bulk_upload.id}"
+ expect(page).to have_link("Back to uploaded logs")
+ end
+ end
+
+ context "without bulk_upload_id filter in session" do
+ it "does not display back to uploaded logs link" do
+ get "/lettings-logs/#{lettings_log.id}"
+ expect(page).not_to have_link("Back to uploaded logs")
+ end
+ end
+ end
end
context "with lettings logs from a closed collection period before the previous collection" do
@@ -1177,7 +1202,7 @@ RSpec.describe LettingsLogsController, type: :request do
it "displays a closed collection window message for previous collection year logs" do
follow_redirect!
- expect(page).to have_content(/This log is from the \d{4}\/\d{4} collection window, which is now closed\./)
+ expect(page).to have_content(/This log is from the \d{4} to \d{4} collection window, which is now closed\./)
end
end
diff --git a/spec/requests/sales_logs_controller_spec.rb b/spec/requests/sales_logs_controller_spec.rb
index 607349a68..4c6ca3cc1 100644
--- a/spec/requests/sales_logs_controller_spec.rb
+++ b/spec/requests/sales_logs_controller_spec.rb
@@ -954,7 +954,7 @@ RSpec.describe SalesLogsController, type: :request do
expect(completed_sales_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 12, 31))
expect(completed_sales_log.status).to eq("completed")
follow_redirect!
- expect(page).to have_content("This log is from the 2021/2022 collection window, which is now closed.")
+ expect(page).to have_content("This log is from the 2021 to 2022 collection window, which is now closed.")
end
end
end
diff --git a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb
index 824754b25..70bd923e6 100644
--- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb
+++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb
@@ -1029,8 +1029,8 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
end
it "populates with correct error message" do
- expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.")
- expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.")
+ expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
+ expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
end
end
diff --git a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb
index 96914fc44..d1d4aeb53 100644
--- a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb
+++ b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb
@@ -1486,8 +1486,8 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do
it "populates with correct error message" do
parser.valid?
- expect(parser.errors.where(:field_31, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.")
- expect(parser.errors.where(:field_35, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.")
+ expect(parser.errors.where(:field_31, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
+ expect(parser.errors.where(:field_35, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
end
end
end
diff --git a/spec/views/logs/edit.html.erb_spec.rb b/spec/views/logs/edit.html.erb_spec.rb
index 9ecb1e5c8..b2dde0f3d 100644
--- a/spec/views/logs/edit.html.erb_spec.rb
+++ b/spec/views/logs/edit.html.erb_spec.rb
@@ -1,11 +1,13 @@
require "rails_helper"
RSpec.describe "logs/edit.html.erb" do
+ let(:current_user) { create(:user, :support) }
+
before do
Timecop.freeze(Time.zone.local(2024, 3, 1))
Singleton.__init__(FormHandler)
assign(:log, log)
- sign_in create(:user, :support)
+ sign_in current_user
end
after do
@@ -17,7 +19,7 @@ RSpec.describe "logs/edit.html.erb" do
let(:log) { create(:lettings_log, :in_progress) }
it "there is no link back to log type root" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -25,7 +27,7 @@ RSpec.describe "logs/edit.html.erb" do
end
it "has link 'Delete log'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -38,7 +40,7 @@ RSpec.describe "logs/edit.html.erb" do
let(:log) { create(:lettings_log, :completed) }
it "has link 'Back to lettings logs'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -46,7 +48,7 @@ RSpec.describe "logs/edit.html.erb" do
end
it "has link 'Delete log'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -58,7 +60,7 @@ RSpec.describe "logs/edit.html.erb" do
let(:log) { create(:sales_log, :completed) }
it "has link 'Back to sales logs'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -66,7 +68,7 @@ RSpec.describe "logs/edit.html.erb" do
end
it "has link 'Delete log'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -79,7 +81,7 @@ RSpec.describe "logs/edit.html.erb" do
let(:log) { create(:lettings_log, :completed, bulk_upload:, creation_method: "bulk upload") }
it "has link 'Back to uploaded logs'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true }
fragment = Capybara::Node::Simple.new(rendered)
@@ -87,7 +89,7 @@ RSpec.describe "logs/edit.html.erb" do
end
it "has link 'Delete log'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true }
fragment = Capybara::Node::Simple.new(rendered)
@@ -99,7 +101,7 @@ RSpec.describe "logs/edit.html.erb" do
let(:log) { create(:lettings_log, :completed, bulk_upload: nil, creation_method: "bulk upload") }
it "does not have link 'Back to uploaded logs'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false }
fragment = Capybara::Node::Simple.new(rendered)
@@ -112,7 +114,7 @@ RSpec.describe "logs/edit.html.erb" do
let(:log) { create(:sales_log, :completed, bulk_upload:, creation_method: "bulk upload") }
it "has link 'Back to uploaded logs'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true }
fragment = Capybara::Node::Simple.new(rendered)
@@ -120,7 +122,7 @@ RSpec.describe "logs/edit.html.erb" do
end
it "has link 'Delete log'" do
- render
+ render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true }
fragment = Capybara::Node::Simple.new(rendered)