elsifincorrect_accuracy||value.to_d!=value.to_i# if the user enters a value in exponent notation (eg '4e1') the to_i method does not convert this to the correct value
elsifincorrect_accuracy||value.to_d!=value.to_i# if the user enters a value in exponent notation (eg '4e1') the to_i method does not convert this to the correct value
merged:"That organisation has already been merged. Select a different organisation."
merged:"That organisation has already been merged. Select a different organisation."
scheme_duplicates_not_resolved:"You must resolve all duplicates or indicate that there are no duplicates"
scheme_duplicates_not_resolved:"You must resolve all duplicates or indicate that there are no duplicates"
not_answered:"You must answer %{question}"
not_answered:"You must answer %{question}"
not_number:"%{field} must be a number."
invalid_option:"Enter a valid value for %{question}"
invalid_option:"Enter a valid value for %{question}"
invalid_number:"Enter a number for %{question}"
invalid_number:"Enter a number for %{question}"
no_address_found:"We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."
no_address_found:"We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."
other_field_missing:"If %{main_field_label} is other then %{other_field_label} must be provided."
other_field_not_required:"%{other_field_label} must not be provided if %{main_field_label} was not other."
numeric:
within_range:"%{field} must be between %{min} and %{max}."
above_min:"%{field} must be at least %{min}."
whole_number:"%{field} must be a whole number."
nearest_ten:"%{field} must be given to the nearest ten."
nearest_hundredth:"%{field} must be given to the nearest hundredth."
normal_format:"Enter a number."
format:"%{field} must be a number."
date:
date:
invalid_date:"Enter a date in the correct format, for example 31 1 2024."
outside_collection_window:"Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}."
outside_collection_window:"Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}."
postcode:"Enter a postcode in the correct format, for example AA1 1AA."
postcode:"Enter a postcode in the correct format, for example AA1 1AA."
location_admin_district:"Select a local authority."
location_admin_district:"Select a local authority."
@ -271,29 +260,8 @@ en:
year_not_two_or_four_digits:"Sale completion year must be 2 or 4 digits."
year_not_two_or_four_digits:"Sale completion year must be 2 or 4 digits."
type:
type:
percentage_bought_must_be_at_least_threshold:"The minimum increase in equity while staircasing is %{threshold}% for this shared ownership type."
percentage_bought_must_be_at_least_threshold:"The minimum increase in equity while staircasing is %{threshold}% for this shared ownership type."
startdate:
startdate:
before_scheme_end_date:"The tenancy start date must be before the end date for this supported housing scheme."
before_scheme_end_date:"The tenancy start date must be before the end date for this supported housing scheme."
location:
deactivated:
startdate:"The location %{postcode} is inactive on this date. Enter another date or choose another location."
location_id:"This location is not active on the tenancy start date. Choose another location or edit the tenancy start date."
activating_soon:
startdate:"The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}."
location_id:"The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date."
reactivating_soon:
startdate:"The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}."
location_id:"The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date."
scheme:
deactivated:
startdate:"The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date."
scheme_id:"The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date."
reactivating_soon:
startdate:"The scheme %{name} is not available until %{date}. Enter a tenancy start date after %{date}."
scheme_id:"The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date."
locations_inactive:
startdate:"The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
scheme_id:"The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
owning_organisation:
owning_organisation:
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
property:
property:
@ -451,7 +419,6 @@ en:
cannot_be_student:"Person cannot be a student if they are aged 16-19 but are not a child."
cannot_be_student:"Person cannot be a student if they are aged 16-19 but are not a child."
relat:
relat:
child_under_16_lettings:"Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16."
child_under_16_lettings:"Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16."
one_partner:"Number of partners cannot be greater than 1."
not_student_16_19:"Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student."
not_student_16_19:"Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student."
owning_organisation:"Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}."
owning_organisation:"Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}."
managing_organisation:"Enter a date when the managing organisation was active. %{managing_organisation} became active on %{available_from}."
managing_organisation:"Enter a date when the managing organisation was active. %{managing_organisation} became active on %{available_from}."
different_organisations:"Enter a date when the owning and managing organisations were active. %{owning_organisation} became active on %{owning_organisation_active_from}, and %{managing_organisation} became active on %{managing_organisation_active_from}."
different_organisations:"Enter a date when the owning and managing organisations were active. %{owning_organisation} became active on %{owning_organisation_active_from}, and %{managing_organisation} became active on %{managing_organisation_active_from}."
location:
deactivated:
startdate:"The location %{postcode} is inactive on this date. Enter another date or choose another location."
location_id:"This location is not active on the tenancy start date. Choose another location or edit the tenancy start date."
activating_soon:
startdate:"The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}."
location_id:"The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date."
reactivating_soon:
startdate:"The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}."
location_id:"The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date."
scheme:
deactivated:
startdate:"The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date."
scheme_id:"The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date."
reactivating_soon:
startdate:"The scheme %{name} is not available until %{date}. Enter a tenancy start date after %{date}."
scheme_id:"The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date."
locations_inactive:
startdate:"The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
scheme_id:"The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
scheme:
incomplete:"This scheme is incomplete. Select another scheme or update this one."
no_completed_locations:"This scheme cannot be chosen as it has no completed locations."
location:
incomplete:"This location is incomplete. Select another location or update this one."
assigned_to:
assigned_to:
invalid:"Please select the owning organisation or managing organisation that you belong to."
invalid:"Please select the owning organisation or managing organisation that you belong to."
owning_organisation:
owning_organisation:
invalid:"Please select the owning organisation or managing organisation that you belong to."
invalid:"Please select the owning organisation or managing organisation that you belong to."
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
inactive:
inactive:
merged_organisation:
merged_organisation:
"The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
"The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
@ -44,10 +72,3 @@ en:
intermediate_rent_product_name:
intermediate_rent_product_name:
blank:"Enter name of other intermediate rent product."
blank:"Enter name of other intermediate rent product."
scheme:
incomplete:"This scheme is incomplete. Select another scheme or update this one."
no_completed_locations:"This scheme cannot be chosen as it has no completed locations."
location:
incomplete:"This location is incomplete. Select another location or update this one."
"Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}."
"Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}."
owning_organisation:
owning_organisation:
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
inactive:
inactive:
merged_organisation:
merged_organisation:
"The owning organisation must be active on the sale completion date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
"The owning organisation must be active on the sale completion date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
it"produces no error when scheme has active locations on the tenancy start date"do
it"produces no error when scheme has active locations on the tenancy start date"do
@ -593,9 +593,9 @@ RSpec.describe Validations::SetupValidations do
record.location=location
record.location=location
setup_validator.validate_location(record)
setup_validator.validate_location(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.location.deactivated.startdate",postcode:location.postcode,date:"4 June 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.deactivated.startdate",postcode:location.postcode,date:"4 June 2022"))
expect(record.errors["location_id"])
expect(record.errors["location_id"])
.toinclude(matchI18n.t("validations.setup.startdate.location.deactivated.location_id",postcode:location.postcode,date:"4 June 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.deactivated.location_id",postcode:location.postcode,date:"4 June 2022"))
end
end
it"produces no error when tenancy start date is during an active location period"do
it"produces no error when tenancy start date is during an active location period"do
@ -622,9 +622,9 @@ RSpec.describe Validations::SetupValidations do
record.location=location
record.location=location
setup_validator.validate_location(record)
setup_validator.validate_location(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon.startdate",postcode:location.postcode,date:"4 August 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.reactivating_soon.startdate",postcode:location.postcode,date:"4 August 2022"))
expect(record.errors["location_id"])
expect(record.errors["location_id"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon.location_id",postcode:location.postcode,date:"4 August 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.reactivating_soon.location_id",postcode:location.postcode,date:"4 August 2022"))
end
end
it"produces no error when tenancy start date is during an active location period"do
it"produces no error when tenancy start date is during an active location period"do
@ -655,9 +655,9 @@ RSpec.describe Validations::SetupValidations do
record.location=location
record.location=location
setup_validator.validate_location(record)
setup_validator.validate_location(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon.startdate",postcode:location.postcode,date:"4 September 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.reactivating_soon.startdate",postcode:location.postcode,date:"4 September 2022"))
expect(record.errors["location_id"])
expect(record.errors["location_id"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon.location_id",postcode:location.postcode,date:"4 September 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.reactivating_soon.location_id",postcode:location.postcode,date:"4 September 2022"))
end
end
it"produces no error when tenancy start date is during an active location period"do
it"produces no error when tenancy start date is during an active location period"do
@ -686,9 +686,9 @@ RSpec.describe Validations::SetupValidations do
record.location=location
record.location=location
setup_validator.validate_location(record)
setup_validator.validate_location(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.location.activating_soon.startdate",postcode:location.postcode,date:"15 September 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.activating_soon.startdate",postcode:location.postcode,date:"15 September 2022"))
expect(record.errors["location_id"])
expect(record.errors["location_id"])
.toinclude(matchI18n.t("validations.setup.startdate.location.activating_soon.location_id",postcode:location.postcode,date:"15 September 2022"))
.toinclude(matchI18n.t("validations.lettings.setup.startdate.location.activating_soon.location_id",postcode:location.postcode,date:"15 September 2022"))
end
end
end
end
@ -726,7 +726,7 @@ RSpec.describe Validations::SetupValidations do
expect(sales_log.errors["savings"]).toinclude(matchI18n.t("validations.numeric.above_min",field:"Buyers’ total savings before any deposit paid",min:"£0"))
expect(sales_log.errors["savings"]).toinclude(matchI18n.t("validations.shared.numeric.above_min",field:"Buyers’ total savings before any deposit paid",min:"£0"))
end
end
context"when validating percent"do
context"when validating percent"do
@ -101,7 +101,7 @@ RSpec.describe Validations::SharedValidations do