|
|
|
|
@ -55,25 +55,21 @@ RSpec.describe BulkUpload::Lettings::Year2023::CsvParser do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# context "when parsing csv without headers" do |
|
|
|
|
# let(:file) { Tempfile.new } |
|
|
|
|
# let(:path) { file.path } |
|
|
|
|
# let(:log) { build(:lettings_log, :completed) } |
|
|
|
|
|
|
|
|
|
# before do |
|
|
|
|
# file.write(BulkUpload::LogToCsv.new(log:, col_offset: 0).to_2022_csv_row) |
|
|
|
|
# file.rewind |
|
|
|
|
# end |
|
|
|
|
context "when parsing csv without headers" do |
|
|
|
|
before do |
|
|
|
|
file.write(BulkUpload::LogToCsv.new(log:, col_offset: 0).to_2023_csv_row) |
|
|
|
|
file.rewind |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# it "returns correct offsets" do |
|
|
|
|
# expect(service.row_offset).to eq(0) |
|
|
|
|
# expect(service.col_offset).to eq(0) |
|
|
|
|
# end |
|
|
|
|
it "returns correct offsets" do |
|
|
|
|
expect(service.row_offset).to eq(0) |
|
|
|
|
expect(service.col_offset).to eq(0) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# it "parses csv correctly" do |
|
|
|
|
# expect(service.row_parsers[0].field_12.to_i).to eql(log.age1) |
|
|
|
|
# end |
|
|
|
|
# end |
|
|
|
|
it "parses csv correctly" do |
|
|
|
|
expect(service.row_parsers[0].field_13).to eql(log.tenancycode) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# context "when parsing with BOM aka byte order mark" do |
|
|
|
|
# let(:file) { Tempfile.new } |
|
|
|
|
|