diff --git a/Gemfile b/Gemfile index 53db06845e..dd46d46965 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem 'hpricot', '~>0.8.2' gem 'libxml-ruby', '~>2.9.0', require: 'libxml' gem 'uuid', '~>2.3' gem 'RedCloth', '>=4.3.0' -gem 'simple-spreadsheet-extractor', '~> 0.18.0' +gem 'simple-spreadsheet-extractor', '0.18.1' gem 'open4' gem 'sample-template-generator', '~>0.7' gem 'rmagick', '4.2.5' diff --git a/Gemfile.lock b/Gemfile.lock index 8f9cfa2612..7410cf9f69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -186,7 +186,7 @@ GEM citeproc-ruby (2.0.0) citeproc (~> 1.0, >= 1.0.9) csl (~> 2.0) - climate_control (0.2.0) + climate_control (1.2.0) code_analyzer (0.5.5) sexp_processor coderay (1.1.3) @@ -774,9 +774,9 @@ GEM rubyntlm (0.6.3) rubyzip (2.0.0) rugged (1.1.0) - sample-template-generator (0.7.0) + sample-template-generator (0.7.1) rdoc (~> 6.0) - terrapin (~> 0.6) + terrapin (~> 1.0) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) @@ -821,9 +821,9 @@ GEM rdf-xsd (~> 3.2) sparql (~> 3.2) sxp (~> 1.2) - simple-spreadsheet-extractor (0.18.0) + simple-spreadsheet-extractor (0.18.1) libxml-ruby (~> 2.9) - terrapin (~> 0.6) + terrapin (~> 1.0) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) @@ -875,8 +875,8 @@ GEM teaspoon-mocha (2.3.3) teaspoon (>= 1.0.0) temple (0.8.2) - terrapin (0.6.0) - climate_control (>= 0.0.3, < 1.0) + terrapin (1.0.1) + climate_control terser (1.1.8) execjs (>= 0.3.0, < 3) test-prof (1.0.7) @@ -1073,7 +1073,7 @@ DEPENDENCIES sass-rails (>= 6) savon (= 1.1.0) seedbank - simple-spreadsheet-extractor (~> 0.18.0) + simple-spreadsheet-extractor (= 0.18.1) simplecov sprockets-rails sqlite3 (~> 1.4) diff --git a/test/factories/content_blobs.rb b/test/factories/content_blobs.rb index b968107ef8..392295c3fe 100644 --- a/test/factories/content_blobs.rb +++ b/test/factories/content_blobs.rb @@ -313,6 +313,12 @@ content_type { 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' } data { File.new("#{Rails.root}/test/fixtures/files/blank-master-template.xlsx", 'rb').read } end + + factory(:spreadsheet_with_error_logs_content_blob, parent: :content_blob) do + original_filename { 'spreadsheet-with-poi-error-logs.xlsx' } + content_type { 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' } + data { File.new("#{Rails.root}/test/fixtures/files/spreadsheet-with-poi-error-logs.xlsx", 'rb').read } + end factory(:blank_content_blob, class: ContentBlob) do url { nil } diff --git a/test/factories/data_files.rb b/test/factories/data_files.rb index 630776077d..6b414f23df 100644 --- a/test/factories/data_files.rb +++ b/test/factories/data_files.rb @@ -121,6 +121,10 @@ factory(:small_test_spreadsheet_datafile, parent: :data_file) do association :content_blob, factory: :small_test_spreadsheet_content_blob end + + factory(:spreadsheet_with_error_logs_datafile, parent: :data_file) do + association :content_blob, factory: :spreadsheet_with_error_logs_content_blob + end factory(:strain_sample_data_file, parent: :data_file) do association :content_blob, factory: :strain_sample_data_content_blob diff --git a/test/fixtures/files/spreadsheet-with-poi-error-logs.xlsx b/test/fixtures/files/spreadsheet-with-poi-error-logs.xlsx new file mode 100644 index 0000000000..54c90e9bf1 Binary files /dev/null and b/test/fixtures/files/spreadsheet-with-poi-error-logs.xlsx differ diff --git a/test/functional/data_files_controller_test.rb b/test/functional/data_files_controller_test.rb index db1506bb81..0d4b0cd3a7 100644 --- a/test/functional/data_files_controller_test.rb +++ b/test/functional/data_files_controller_test.rb @@ -1255,6 +1255,13 @@ def test_show_item_attributed_to_jerm_file assert_response :success end + test 'explore spreadsheet with error logs' do + data = FactoryBot.create :spreadsheet_with_error_logs_datafile, policy: FactoryBot.create(:public_policy) + get :explore, params: { id: data } + assert_response :success + assert_select 'div#spreadsheet_1 table.sheet td#cell_B4',text:'ProjectDescription' + end + test 'explore earlier version' do df = FactoryBot.create(:small_test_spreadsheet_datafile)