From d08900f11ac3ebd53a2ee882128789134aea2939 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Wed, 25 Jan 2023 11:06:05 +0000 Subject: [PATCH] fill place holder with remaining logs to fix --- app/views/logs/index.html.erb | 4 ++-- spec/requests/lettings_logs_controller_spec.rb | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/logs/index.html.erb b/app/views/logs/index.html.erb index 926ee8378..31768c731 100644 --- a/app/views/logs/index.html.erb +++ b/app/views/logs/index.html.erb @@ -18,12 +18,12 @@ <% end %> <% end %> -<% unless @bulk_upload %> +<% if @bulk_upload.blank? %> <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "#{log_type_for_controller(controller).capitalize} logs", sub: nil } : { main: "#{log_type_for_controller(controller).capitalize} logs", sub: current_user.organisation.name } %> <% else %> <%= render partial: "organisations/headings", locals: { - main: "You need to fix XYZ logs from your bulk upload", + main: "You need to fix #{pluralize(@pagy.count, 'log')} from your bulk upload", sub: "#{log_type_for_controller(controller).capitalize} logs (#{@bulk_upload.year_combo})", } %> diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index 6cb0b02d2..8c706c930 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -418,6 +418,11 @@ RSpec.describe LettingsLogsController, type: :request do expect(page).not_to have_content(excluded_log.id) end + it "dislays how many logs remaining to fix" do + get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" + expect(page).to have_content("You need to fix 1 log") + end + it "displays filter" do get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" expect(page).to have_content("With logs from bulk upload")