From 4fe4a453973390bff20559da5e12c297498f83b6 Mon Sep 17 00:00:00 2001 From: Scott Rohde Date: Fri, 9 Aug 2019 15:10:46 -0500 Subject: [PATCH] Skip the test for blank lines in CSV files since these are now parsed without error in Ruby 2.6. Also, fixed a capybara-webkit based test which started failing regularly under Ruby 2.6. --- spec/controllers/bulk_upload_controller_spec.rb | 5 ++++- spec/features/site_integration_spec.rb | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/controllers/bulk_upload_controller_spec.rb b/spec/controllers/bulk_upload_controller_spec.rb index 2dc77c361..4f10db5fc 100644 --- a/spec/controllers/bulk_upload_controller_spec.rb +++ b/spec/controllers/bulk_upload_controller_spec.rb @@ -119,7 +119,10 @@ class BulkUploadController # TODO: possibly test various kinds of invalid files and what messages result context "uploading an invalid csv file" do - it "should throw an error and redirect to the start_upload page" do + # This test tests for blank lines in the CSV file, which are no longer + # invalid in Ruby 2.6. So we skip this test but keep it around for + # documentation. + it "should throw an error and redirect to the start_upload page", skip: true do @file = fixture_file_upload("/files/bulk_upload/invalid_file.csv", "text/csv") @form = { 'new upload' => true, "CSV file" => @file } diff --git a/spec/features/site_integration_spec.rb b/spec/features/site_integration_spec.rb index cd488431d..32ab52ab3 100644 --- a/spec/features/site_integration_spec.rb +++ b/spec/features/site_integration_spec.rb @@ -56,7 +56,9 @@ it 'show allow adding new related citations', js: true do click_link 'View Related Citations' fill_in 'search_citations', with: 'Wood' - sleep 2 # 1 often isn't enough + # In Ruby 2.6 especially, merely filling in a field doesn't seem to + # trigger the needed keyup event, so do it manually: + find_field('search_citations').trigger(:keyup) click_link '+' click_button 'Update' # reopen related citations listing