Browse Source

Fix lint

pull/2666/head
Manny Dinssa 2 years ago
parent
commit
362c6dd359
  1. 4
      app/components/bulk_upload_summary_component.rb
  2. 10
      spec/models/bulk_upload_spec.rb

4
app/components/bulk_upload_summary_component.rb

@ -57,9 +57,9 @@ class BulkUploadSummaryComponent < ViewComponent::Base
path = if status == "important_errors" path = if status == "important_errors"
"summary_bulk_upload_#{bulk_upload.log_type}_result_url" "summary_bulk_upload_#{bulk_upload.log_type}_result_url"
else else
"bulk_upload_#{bulk_upload.log_type}_result_path" "bulk_upload_#{bulk_upload.log_type}_result_path"
end end
link_to "View error report", send(path, bulk_upload), class: "govuk-link" link_to "View error report", send(path, bulk_upload), class: "govuk-link"
end end

10
spec/models/bulk_upload_spec.rb

@ -234,7 +234,10 @@ RSpec.describe BulkUpload, type: :model do
context "when the bulk upload has visible logs, errors and is not complete" do context "when the bulk upload has visible logs, errors and is not complete" do
let(:bulk_upload_errors) { create_list(:bulk_upload_error, 2, category: "soft_validation") } let(:bulk_upload_errors) { create_list(:bulk_upload_error, 2, category: "soft_validation") }
let(:bulk_upload) { create(:bulk_upload, :lettings, bulk_upload_errors:) } let(:bulk_upload) { create(:bulk_upload, :lettings, bulk_upload_errors:) }
let!(:log) { create(:lettings_log, :in_progress, bulk_upload:) }
before do
create(:lettings_log, :in_progress, bulk_upload:)
end
it "returns logs_uploaded_with_errors" do it "returns logs_uploaded_with_errors" do
expect(bulk_upload.status).to eq(:logs_uploaded_with_errors) expect(bulk_upload.status).to eq(:logs_uploaded_with_errors)
@ -244,7 +247,10 @@ RSpec.describe BulkUpload, type: :model do
context "when the bulk upload has visible logs, errors and is complete" do context "when the bulk upload has visible logs, errors and is complete" do
let(:bulk_upload_errors) { create_list(:bulk_upload_error, 2, category: "soft_validation") } let(:bulk_upload_errors) { create_list(:bulk_upload_error, 2, category: "soft_validation") }
let(:bulk_upload) { create(:bulk_upload, :lettings, bulk_upload_errors:) } let(:bulk_upload) { create(:bulk_upload, :lettings, bulk_upload_errors:) }
let!(:log) { create(:lettings_log, :completed, bulk_upload:) }
before do
create(:lettings_log, :completed, bulk_upload:)
end
it "returns errors_fixed_in_service" do it "returns errors_fixed_in_service" do
expect(bulk_upload.status).to eq(:errors_fixed_in_service) expect(bulk_upload.status).to eq(:errors_fixed_in_service)

Loading…
Cancel
Save