after_major_repair_date:"Enter a tenancy start date that is after the major repair date"
after_major_repair_date:"Enter a tenancy start date that is after the major repair date"
location:
location:
deactivated:"The location %{postcode} was deactivated on %{date} and was not available on the day you entered."
deactivated:"The location %{postcode} was deactivated on %{date} and was not available on the day you entered."
reactivating_soon:"The location %{postcode} was deactivated on %{deactivation_date} and is not available on the date you entered. It reactivates on %{date}"
reactivating_soon:"The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date"
activating_soon:"The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}"
activating_soon:"The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}"
scheme:
scheme:
deactivated:"%{name} was deactivated on %{date} and was not available on the day you entered"
deactivated:"%{name} was deactivated on %{date} and was not available on the day you entered"
reactivating_soon:"%{name} was deactivated on %{deactivation_date} and is not available on the date you entered. It reactivates on %{date}"
reactivating_soon:"The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date"
activating_soon:"%{name} is not available until %{date}. Enter a tenancy start date after %{date}"
activating_soon:"%{name} is not available until %{date}. Enter a tenancy start date after %{date}"
@ -123,7 +123,7 @@ RSpec.describe Validations::DateValidations do
record.location=location
record.location=location
date_validator.validate_startdate(record)
date_validator.validate_startdate(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",postcode:location.postcode,date:"4 August 2022",deactivation_date:"4 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",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
@ -150,7 +150,7 @@ RSpec.describe Validations::DateValidations do
record.location=location
record.location=location
date_validator.validate_startdate(record)
date_validator.validate_startdate(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",postcode:location.postcode,date:"4 September 2022",deactivation_date:"1 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",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
@ -194,7 +194,7 @@ RSpec.describe Validations::DateValidations do
record.scheme=scheme
record.scheme=scheme
date_validator.validate_startdate(record)
date_validator.validate_startdate(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 August 2022",deactivation_date:"4 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 August 2022"))
end
end
it"produces no error when tenancy start date is during an active scheme period"do
it"produces no error when tenancy start date is during an active scheme period"do
@ -220,7 +220,7 @@ RSpec.describe Validations::DateValidations do
record.scheme=scheme
record.scheme=scheme
date_validator.validate_startdate(record)
date_validator.validate_startdate(record)
expect(record.errors["startdate"])
expect(record.errors["startdate"])
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 September 2022",deactivation_date:"1 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 September 2022"))
end
end
it"produces no error when tenancy start date is during an active scheme period"do
it"produces no error when tenancy start date is during an active scheme period"do
@ -71,7 +71,7 @@ RSpec.describe Validations::SetupValidations do
record.location=location
record.location=location
setup_validator.validate_scheme(record)
setup_validator.validate_scheme(record)
expect(record.errors["scheme_id"])
expect(record.errors["scheme_id"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",postcode:location.postcode,date:"4 August 2022",deactivation_date:"4 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",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
@ -115,7 +115,7 @@ RSpec.describe Validations::SetupValidations do
record.scheme=scheme
record.scheme=scheme
setup_validator.validate_scheme(record)
setup_validator.validate_scheme(record)
expect(record.errors["scheme_id"])
expect(record.errors["scheme_id"])
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 August 2022",deactivation_date:"4 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 August 2022"))
end
end
it"produces no error when tenancy start date is during an active scheme period"do
it"produces no error when tenancy start date is during an active scheme period"do
@ -141,7 +141,7 @@ RSpec.describe Validations::SetupValidations do
record.scheme=scheme
record.scheme=scheme
setup_validator.validate_scheme(record)
setup_validator.validate_scheme(record)
expect(record.errors["scheme_id"])
expect(record.errors["scheme_id"])
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 September 2022",deactivation_date:"1 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.scheme.reactivating_soon",name:scheme.service_name,date:"4 September 2022"))
end
end
it"produces no error when tenancy start date is during an active scheme period"do
it"produces no error when tenancy start date is during an active scheme period"do
@ -193,7 +193,7 @@ RSpec.describe Validations::SetupValidations do
record.location=location
record.location=location
setup_validator.validate_location(record)
setup_validator.validate_location(record)
expect(record.errors["location_id"])
expect(record.errors["location_id"])
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",postcode:location.postcode,date:"4 August 2022",deactivation_date:"4 June 2022"))
.toinclude(matchI18n.t("validations.setup.startdate.location.reactivating_soon",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