Skip to content

Commit

Permalink
Add tests for the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaeftekhar committed Jan 3, 2024
1 parent 0a08389 commit 90e08d6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/decidim/term_customizer/import/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def collection_data
data_headers = []
reader.new(file).read_rows do |rowdata, index|
if index.zero?
data_headers = rowdata.map do |cell|
cell.to_sym if cell.present?
end
data_headers = rowdata.compact_blank.map(&:to_sym)
else
next if rowdata.blank?

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
context "with xlsx files containing nils in header" do
let(:file) { file_fixture("set-translations-with-nils.xlsx") }

it_behaves_like "translation import reader"
it_behaves_like "translation import reader"
end
end
2 changes: 1 addition & 1 deletion spec/shared/translation_importer_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
it "yields all the data correctly" do
data = []
subject.read_rows do |row, index|
data[index] = row.map(&:to_s)
data[index] = row.compact_blank.map(&:to_s)
end

expected_array = []
Expand Down

0 comments on commit 90e08d6

Please sign in to comment.