From d1683d755f902f77009589eba39b46d52244a178 Mon Sep 17 00:00:00 2001 From: Kat Date: Fri, 14 Jul 2023 09:04:13 +0100 Subject: [PATCH] update bulk upload banner --- app/views/logs/index.html.erb | 4 ++-- spec/requests/lettings_logs_controller_spec.rb | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/logs/index.html.erb b/app/views/logs/index.html.erb index eac53ed7c..78b1d9eed 100644 --- a/app/views/logs/index.html.erb +++ b/app/views/logs/index.html.erb @@ -28,7 +28,7 @@ <% else %> <%= render partial: "organisations/headings", locals: { - main: "You need to fix #{pluralize(@pagy.count, 'log')} from your bulk upload", + main: "Fix the errors from this bulk upload", sub: "#{log_type_for_controller(controller).capitalize} logs (#{@bulk_upload.year_combo})", } %> @@ -36,7 +36,7 @@

- The following logs are from your recent bulk upload. They have some incorrect or incomplete data. You’ll need to answer a few more questions for each one to mark them as complete. + You have uploaded <%= pluralize(@bulk_upload.logs.count, "log") %>. There are errors in <%= pluralize(@bulk_upload.logs_with_errors_count, "log") %> and <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in total. Select the log to fix the errors.

diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index ae8770c7a..c3d12441b 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -477,6 +477,10 @@ RSpec.describe LettingsLogsController, type: :request do let!(:included_log) { create(:lettings_log, :in_progress, bulk_upload:, owning_organisation: organisation) } let!(:excluded_log) { create(:lettings_log, :in_progress, owning_organisation: organisation, tenancycode: "fake_code") } + before do + create(:bulk_upload_error, bulk_upload:, col: "A", row: 1) + end + it "returns logs only associated with the bulk upload" do get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" @@ -484,9 +488,9 @@ RSpec.describe LettingsLogsController, type: :request do expect(page).not_to have_content(excluded_log.tenancycode) end - it "displays how many logs remaining to fix" do + it "dislays bulk uplaoad header" do get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" - expect(page).to have_content("You need to fix 1 log") + expect(page).to have_content("Fix the errors from this bulk upload") end it "displays filter" do @@ -517,7 +521,7 @@ RSpec.describe LettingsLogsController, type: :request do it "displays card with help info" do get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" - expect(page).to have_content("The following logs are from your recent bulk upload") + expect(page).to have_content("You have uploaded 1 log. There are errors in 1 log and 1 error in total. Select the log to fix the errors.") end it "displays meta info about the bulk upload" do