Browse Source

Spec empty file handling

pull/84/head
baarkerlounger 4 years ago
parent
commit
19730f7690
  1. BIN
      spec/fixtures/files/2021_22_lettings_bulk_upload_empty.xlsx
  2. 11
      spec/requests/bulk_upload_controller_spec.rb

BIN
spec/fixtures/files/2021_22_lettings_bulk_upload_empty.xlsx vendored

Binary file not shown.

11
spec/requests/bulk_upload_controller_spec.rb

@ -45,5 +45,16 @@ RSpec.describe BulkUploadController, type: :request do
expect(response.body).to match(/Invalid file type/) expect(response.body).to match(/Invalid file type/)
end end
end end
context "given an empty file" do
before do
@file = fixture_file_upload("2021_22_lettings_bulk_upload_empty.xlsx", "application/vnd.ms-excel")
subject
end
it "displays an error message" do
expect(response.body).to match(/No data found/)
end
end
end end
end end

Loading…
Cancel
Save