Browse Source

fill place holder with remaining logs to fix

pull/1223/head
Phil Lee 3 years ago
parent
commit
d08900f11a
  1. 4
      app/views/logs/index.html.erb
  2. 5
      spec/requests/lettings_logs_controller_spec.rb

4
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})",
} %>

5
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")

Loading…
Cancel
Save