Browse Source

update bulk upload banner

pull/1777/head
Kat 3 years ago
parent
commit
d1683d755f
  1. 4
      app/views/logs/index.html.erb
  2. 10
      spec/requests/lettings_logs_controller_spec.rb

4
app/views/logs/index.html.erb

@ -28,7 +28,7 @@
<% else %> <% else %>
<%= render partial: "organisations/headings", <%= render partial: "organisations/headings",
locals: { 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})", sub: "#{log_type_for_controller(controller).capitalize} logs (#{@bulk_upload.year_combo})",
} %> } %>
@ -36,7 +36,7 @@
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<p class="govuk-body-l"> <p class="govuk-body-l">
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.
</p> </p>
<p class="govuk-body"> <p class="govuk-body">

10
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!(: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") } 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 it "returns logs only associated with the bulk upload" do
get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" 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) expect(page).not_to have_content(excluded_log.tenancycode)
end 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}" 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 end
it "displays filter" do it "displays filter" do
@ -517,7 +521,7 @@ RSpec.describe LettingsLogsController, type: :request do
it "displays card with help info" do it "displays card with help info" do
get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" 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 end
it "displays meta info about the bulk upload" do it "displays meta info about the bulk upload" do

Loading…
Cancel
Save