reassigned_logs_text="There #{assigned_logs_count} assigned to you. The stock owner and managing agent on #{logs_count==1?'this log':'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}."
when"reassign_stock_owner"
reassigned_logs_text="There #{assigned_logs_count} assigned to you. The stock owner on #{logs_count==1?'this log':'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}."
when"reassign_managing_agent"
reassigned_logs_text="There #{assigned_logs_count} assigned to you. The managing agent on #{logs_count==1?'this log':'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}."
when"unassign"
reassigned_logs_text="There #{assigned_logs_count} assigned to you. #{logs_count==1?'This':'These'} have now been unassigned."
<% if current_user.id == @bulk_upload.moved_user_id %>
You moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.
<% else %>
Some logs in this upload are assigned to <%= @bulk_upload.moved_user_name %>, who has moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.
<%= accordion.with_section(heading_text: "Next steps") do %>
<p class="govuk-body">Once you've saved your CSV file, you can upload it via a button at the top of the lettings and sales logs pages.</p>
<p class="govuk-body">When your file is done processing, you will receive an email explaining your next steps. If all your data is valid, your logs will be created. If some data is invalid, you’ll receive an email with instructions about how to resolve the errors.</p>
<p class="govuk-body">If your file has errors on fields 1 through 17, you must fix these in the CSV. This is because we need to know these answers to validate the rest of the data. Any errors in these fields will be featured in the error report’s summary tab.</p>
<p class="govuk-body">If none of your errors are in fields 1 through 17, you can choose how to fix the errors. You can either fix them in the CSV and reupload, or create partially complete logs and answer the remaining questions on the CORE site. Any errors that affect a significant number of logs will be featured in the error report’s summary tab to help you decide.</p>
<p class="govuk-body">If your file has errors on fields 1 through 15 for lettings, or 1 through 18 for sales, you must fix these in the CSV. This is because we need to know these answers to validate the rest of the data. Any errors in these fields will be featured in the error report’s summary tab.</p>
<p class="govuk-body">If none of your errors are in fields 1 through 15 for lettings, or 1 through 18 for sales, you can choose how to fix the errors. You can either fix them in the CSV and reupload, or create partially complete logs and answer the remaining questions on the CORE site. Any errors that affect a significant number of logs will be featured in the error report’s summary tab to help you decide.</p>
expected_text="You’re moving #{user.name} from #{user.organisation.name} to #{current_user.organisation.name}. The stock owner and managing agent on their logs will change to #{current_user.organisation.name}."
expected_text="You’re moving #{user.name} from #{user.organisation.name} to #{current_user.organisation.name}. The stock owner on their logs will change to #{current_user.organisation.name}."
expected_text="You’re moving #{user.name} from #{user.organisation.name} to #{current_user.organisation.name}. The managing agent on their logs will change to #{current_user.organisation.name}."
reassigned_logs_text:"There are 2 logs assigned to you. The stock owner and managing agent on these logs has been changed from #{user.organisation.name} to #{new_organisation.name}.",
reassigned_logs_text:"There are 2 logs assigned to you. The stock owner on these logs has been changed from #{user.organisation.name} to #{new_organisation.name}.",
reassigned_logs_text:"There are 2 logs assigned to you. The managing agent on these logs has been changed from #{user.organisation.name} to #{new_organisation.name}.",
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("Some logs in this upload are assigned to #{user.name}, who has moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
end
end
context"and bulk upload has been cancelled by the current moved user"do
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("You moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
end
end
end
end
@ -107,5 +129,28 @@ RSpec.describe BulkUploadLettingsResultsController, type: :request do
expect(response).tobe_not_found
end
end
context"and bulk upload has been cancelled by not the current moved user"do
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("Some logs in this upload are assigned to #{other_user.name}, who has moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
end
end
context"and bulk upload has been cancelled by the current moved user"do
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("You moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("Some logs in this upload are assigned to #{user.name}, who has moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
end
end
context"and bulk upload has been cancelled by the current moved user"do
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("You moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("Some logs in this upload are assigned to #{other_user.name}, who has moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
end
end
context"and bulk upload has been cancelled by the current moved user"do
expect(response.body).toinclude("This error report is out of date.")
expect(response.body).toinclude("You moved to a different organisation since this file was uploaded. Reupload the file to get an accurate error report.")
expect(page).tohave_content("New org must be a stock owner of #{other_user.organisation_name}, #{new_organisation_2.name}, and #{new_organisation_3.name} to make this change.")
end
end
end
context"and log reassignment choice is to change managing agent"do
expect(page).tohave_content("New org must be a managing agent of #{other_user.organisation_name}, #{new_organisation_2.name}, and #{new_organisation_3.name} to make this change.")
end
end
end
end
@ -2194,6 +2423,151 @@ RSpec.describe UsersController, type: :request do
expect(page).tohave_content("Are you sure you want to move this user?")
expect(page).tohave_content("You’re moving #{other_user.name} from #{other_user.organisation_name} to #{new_organisation.name}. The stock owner and managing agent on their logs will change to #{new_organisation.name}.")