Skip to content

Commit 1d587c4

Browse files
authored
Add tests to #83 (#90)
1 parent 7ec7320 commit 1d587c4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/csv_importer/report.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Report
1212

1313
attribute :status, Symbol, default: proc { :pending }
1414

15-
attribute :missing_columns, Array[Symbol], default: proc { [] }
16-
attribute :extra_columns, Array[Symbol], default: proc { [] }
15+
attribute :missing_columns, Array[String], default: proc { [] }
16+
attribute :extra_columns, Array[String], default: proc { [] }
1717

1818
attribute :parser_error, String
1919

spec/csv_importer_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class ImportUserCSVByFirstName
224224

225225
expect(report).to_not be_success
226226
expect(report.status).to eq(:invalid_header)
227-
expect(report.missing_columns).to eq([:email])
227+
expect(report.missing_columns).to eq(["email"])
228228
expect(report.message).to eq("The following columns are required: email")
229229
end
230230
end
@@ -248,6 +248,9 @@ class ImportUserCSVByFirstName
248248
import = ImportUserCSV.new(content: csv_content)
249249

250250
expect(import.header.extra_columns).to eq(["age"])
251+
252+
report = import.run!
253+
expect(report.extra_columns).to eq(["age"])
251254
end
252255
end
253256

0 commit comments

Comments
 (0)