answer_opts[org.id]="#{org.name} (inactive as of #{org.merge_date.to_fs(:govuk_date)})"iforg.merge_date>=FormHandler.instance.start_date_of_earliest_open_for_editing_collection_period
deduplication_success_banner:"%{log_link} is no longer a duplicate and has been removed from the list.<p class=\"govuk-body govuk-!-margin-top-4\">You changed the %{changed_question_label}.</p>"
validations:
validations:
organisation:
organisation:
@ -252,6 +254,17 @@ en:
year_not_two_digits:Tenancy start year must be 2 digits
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_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"
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}."
location:
location:
deactivated:
deactivated:
@ -273,9 +286,13 @@ en:
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."
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
inactive_merged_organisation:"The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
inactive_absorbing_organisation:"The owning organisation must be active on the tenancy start date. %{owning_organisation} became active on %{owning_organisation_available_from}."
managing_organisation:
managing_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 managing organisation."
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the managing organisation."
inactive_merged_organisation:"The managing organisation must be active on the tenancy start date. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
inactive_absorbing_organisation:"The managing organisation must be active on the tenancy start date. %{managing_organisation} became active on %{managing_organisation_available_from}."
created_by:
created_by:
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"
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
expect(record.errors["owning_organisation_id"]).toinclude(match"The owning organisation must be active on the tenancy start date. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
it"allows organisation before it has been merged"do
expect(record.errors["owning_organisation_id"]).toinclude(match"The owning organisation must be active on the tenancy start date. Absorbing org became active on 1 February 2023.")
end
it"allows absorbing organisation after it has been created"do
expect(record.errors["managing_organisation_id"]).toinclude(match"The managing organisation must be active on the tenancy start date. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
it"allows organisation before it has been merged"do
expect(record.errors["managing_organisation_id"]).toinclude(match"The managing organisation must be active on the tenancy start date. Absorbing org became active on 1 February 2023.")
end
it"allows absorbing organisation after it has been created"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{lettings_log.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
end
end
end
it"displays buttons to delete"do
context"when there are no more duplicate logs"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
beforedo
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{lettings_log.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
end
it"displays check your answers for each log with correct questions"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{sales_log.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{sales_log.id}")
end
end
end
it"displays buttons to delete"do
context"when there are no more duplicate logs"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
beforedo
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{sales_log.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{sales_log.id}")
end
it"displays check your answers for each log with correct questions"do
expect(page).tohave_content("Q1 - Sale completion date",count:1)