year_not_two_digits:Tenancy start year must be 2 digits
ten_years_after_void_date:"Enter a tenancy start date that is no more than 10 years after the void date"
ten_years_after_mrc_date:"Enter a tenancy start date that is no more than 10 years after the major repairs completion date"
invalid_merged_organisations_start_date:
same_organisation:"Enter a date when the owning and managing organisation was active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
same_merge:"Enter a date when the owning and managing organisations were active. %{owning_organisation} and %{managing_organisation} became inactive on %{owning_organisation_merge_date} and were replaced by %{owning_absorbing_organisation}."
owning_organisation:"Enter a date when the owning organisation was active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
managing_organisation:"Enter a date when the managing organisation was active. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
different_merge:"Enter a date when the owning and managing organisations were active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
invalid_absorbing_organisations_start_date:
same_organisation:"Enter a date when the owning and managing organisation was active. %{owning_organisation} became active on %{owning_organisation_available_from}."
owning_organisation:"Enter a date when the owning organisation was active. %{owning_organisation} became active on %{owning_organisation_available_from}."
managing_organisation:"Enter a date when the managing organisation was active. %{managing_organisation} became active on %{managing_organisation_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}."
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
it"allows startate before organisation has been merged"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning organisation was active. Absorbing org became active on 1 February 2023.")
end
it"allows startate after absorbing organisation has been created"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the managing organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
it"allows startate before organisation has been merged"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the managing organisation was active. Absorbing org became active on 1 February 2023.")
end
it"allows startate after absorbing organisation has been created"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
it"allows startate before organisation has been merged"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisation was active. Absorbing org became active on 1 February 2023.")
end
it"allows startate after absorbing organisation has been created"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Merged org 2 and Merged org became inactive on 2 February 2023 and were replaced by Absorbing org.")
end
it"allows startate before organisations have been merged"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Merged org 2 became inactive on 2 February 2023 and was replaced by Absorbing org 2. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
it"allows startate before organisations have been merged"do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Absorbing org 2 became active on 1 February 2023, and Absorbing org became active on 1 February 2023.")
end
it"allows startate after absorbing organisation has been created"do