From 4680ace3e0b6728b3766167e3a0d8b87b4b1487f Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 5 Jan 2024 14:39:07 -0600 Subject: [PATCH 1/5] Upgrade to ruby 3.0 in the Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1bb06952e..0bfdd129a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG RUBY_VERSION=2.7.7 +ARG RUBY_VERSION=3.0.6 ARG ALPINE_VERSION=3.16 FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION @@ -33,7 +33,7 @@ RUN addgroup --gid 10001 --system spotlight && \ USER spotlight RUN gem update bundler -RUN gem install --no-document rails -v "${RAILS_VERISION}" +RUN gem install --no-document rails -v "${RAILS_VERSION}" COPY --chown=10000:10001 . /spotlight/engine WORKDIR /spotlight/engine From 529b508c0c4732803718f1fe32c31ac84a90aa58 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 5 Jan 2024 14:41:54 -0600 Subject: [PATCH 2/5] Update rubocop --- .rubocop_todo.yml | 146 ++---------------- app/services/spotlight/etl/executor.rb | 2 +- spec/features/add_contacts_spec.rb | 2 +- .../add_custom_field_metadata_spec.rb | 4 +- spec/features/add_items_spec.rb | 2 +- spec/features/autocomplete_typeahead_spec.rb | 6 +- spec/features/browse_category_admin_spec.rb | 2 +- spec/features/browse_category_spec.rb | 16 +- spec/features/exhibit_masthead_spec.rb | 8 +- spec/features/exhibits/administration_spec.rb | 10 +- .../exhibits/language_create_edit_spec.rb | 2 +- .../exhibits/translation_editing_spec.rb | 8 +- spec/features/feature_page_spec.rb | 6 +- spec/features/home_page_spec.rb | 2 +- spec/features/item_admin_spec.rb | 6 +- .../browse_group_categories_block_spec.rb | 4 +- .../featured_browse_categories_block_spec.rb | 4 +- .../blocks/link_to_search_block_spec.rb | 4 +- .../blocks/search_result_block_spec.rb | 6 +- .../blocks/solr_documents_block_spec.rb | 6 +- .../blocks/uploaded_items_block_spec.rb | 2 +- .../features/javascript/edit_in_place_spec.rb | 16 +- .../javascript/feature_page_admin_spec.rb | 6 +- .../javascript/home_page_edit_spec.rb | 2 +- .../javascript/locale_selector_spec.rb | 2 +- .../javascript/metadata_admin_spec.rb | 8 +- .../javascript/multi_image_select_spec.rb | 4 +- spec/features/javascript/roles_admin_spec.rb | 2 +- .../javascript/search_config_admin_spec.rb | 14 +- .../javascript/search_context_spec.rb | 4 +- spec/features/main_navigation_spec.rb | 4 +- spec/features/report_a_problem_spec.rb | 2 +- spec/features/site_masthead_spec.rb | 6 +- spec/features/site_users_management_spec.rb | 2 +- .../spotlight/crud_link_helpers_spec.rb | 2 +- spec/helpers/spotlight/title_helper_spec.rb | 2 +- spec/models/spotlight/page_spec.rb | 2 +- .../spotlight/solr_document_sidecar_spec.rb | 2 +- .../support/features/test_features_helpers.rb | 2 +- .../shared/_exhibit_navbar.html.erb_spec.rb | 14 +- spec/views/shared/_masthead.html.erb_spec.rb | 2 +- .../shared/_user_util_links.html.erb_spec.rb | 4 +- .../about_pages/_empty.html.erb_spec.rb | 2 +- .../about_pages/_sidebar.html.erb_spec.rb | 2 +- .../about_pages/index.html.erb_spec.rb | 2 +- .../spotlight/browse/show.html.erb_spec.rb | 6 +- .../catalog/_edit_default.html.erb_spec.rb | 8 +- .../spotlight/catalog/admin.html.erb_spec.rb | 2 +- .../spotlight/exhibits/_form.html.erb_spec.rb | 4 +- .../spotlight/exhibits/index.html.erb_spec.rb | 10 +- .../feature_pages/_empty.html.erb_spec.rb | 2 +- .../feature_pages/_sidebar.html.erb_spec.rb | 6 +- .../home_pages/_empty.html.erb_spec.rb | 2 +- .../spotlight/pages/edit.html.erb_spec.rb | 6 +- .../spotlight/pages/index.html.erb_spec.rb | 2 +- .../spotlight/pages/show.html.erb_spec.rb | 2 +- .../_facets.html.erb_spec.rb | 4 +- .../_search_fields.html.erb_spec.rb | 6 +- .../_sort.html.erb_spec.rb | 2 +- .../shared/_exhibit_sidebar.html.erb_spec.rb | 2 +- ...olr_documents_embed_block.html.erb_spec.rb | 2 +- .../translations/_page.html.erb_spec.rb | 4 +- 62 files changed, 157 insertions(+), 269 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 366325c31..b20feeb45 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config --no-auto-gen-timestamp` -# using RuboCop version 1.50.2. +# using RuboCop version 1.59.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 13 +# Offense count: 18 # Configuration parameters: EnforcedStyle, AllowedGems, Include. # SupportedStyles: Gemfile, gems.rb, gemspec # Include: **/*.gemspec, **/Gemfile, **/gems.rb @@ -14,93 +14,8 @@ Gemspec/DevelopmentDependencies: Exclude: - 'blacklight-spotlight.gemspec' -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleAlignWith. -# SupportedStylesAlignWith: either, start_of_block, start_of_line -Layout/BlockAlignment: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -Layout/BlockEndNewline: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Layout/ClosingParenthesisIndentation: - Exclude: - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb' - -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLines: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - - 'spec/views/spotlight/browse/_search.html.erb_spec.rb' - - 'spec/views/spotlight/browse/show.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses -Layout/FirstArgumentIndentation: - Exclude: - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb' - -# Offense count: 22 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: normal, indented_internal_methods -Layout/IndentationConsistency: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - - 'spec/views/spotlight/browse/_search.html.erb_spec.rb' - - 'spec/views/spotlight/browse/show.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb' - # Offense count: 8 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Width, AllowedPatterns. -Layout/IndentationWidth: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -Layout/MultilineBlockLayout: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowInHeredoc. -Layout/TrailingWhitespace: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - -# Offense count: 8 # Configuration parameters: AllowedMethods, AllowedPatterns. Lint/AmbiguousBlockAssociation: Exclude: @@ -144,6 +59,7 @@ Lint/EmptyFile: - 'spec/lib/spotlight/catalog_spec.rb' # Offense count: 1 +# Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - 'app/services/spotlight/carrierwave_file_resolver.rb' @@ -153,19 +69,14 @@ Lint/NoReturnInBeginEndBlocks: Exclude: - 'app/models/spotlight/exhibit.rb' -# Offense count: 1 +# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods. -# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal? +# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?, presence, present? Lint/RedundantSafeNavigation: Exclude: - 'app/controllers/spotlight/catalog_controller.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Lint/RedundantStringCoercion: - Exclude: - - 'lib/tasks/spotlight_tasks.rake' + - 'app/services/spotlight/bulk_updates_csv_template_service.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -205,6 +116,7 @@ Naming/HeredocDelimiterNaming: - 'spec/test_app_templates/lib/generators/test_app_generator.rb' # Offense count: 8 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -367,19 +279,6 @@ RSpec/RepeatedExampleGroupBody: Exclude: - 'spec/controllers/spotlight/featured_images_controller_spec.rb' -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -RSpec/ScatteredSetup: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - - 'spec/views/spotlight/browse/_search.html.erb_spec.rb' - - 'spec/views/spotlight/browse/show.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb' - - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb' - # Offense count: 59 RSpec/StubbedMock: Enabled: false @@ -555,20 +454,8 @@ Rails/UnknownEnv: Exclude: - 'spec/test_app_templates/carrierwave.rb' -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. -# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces -# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object -# FunctionalMethods: let, let!, subject, watch -# AllowedMethods: lambda, proc, it -Style/BlockDelimiters: - Exclude: - - 'spec/controllers/spotlight/solr_controller_spec.rb' - - 'spec/features/item_admin_spec.rb' - - 'spec/helpers/spotlight/main_app_helpers_spec.rb' - # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CombinableLoops: Exclude: - 'app/services/spotlight/exhibit_import_export_service.rb' @@ -579,13 +466,18 @@ Style/CommentedKeyword: Exclude: - 'spec/features/javascript/search_config_admin_spec.rb' -# Offense count: 3 +# Offense count: 8 # This cop supports unsafe autocorrection (--autocorrect-all). Style/ConcatArrayLiterals: Exclude: - 'app/controllers/spotlight/about_pages_controller.rb' - 'app/controllers/spotlight/feature_pages_controller.rb' - 'app/controllers/spotlight/home_pages_controller.rb' + - 'app/models/spotlight/about_page.rb' + - 'app/models/spotlight/exhibit.rb' + - 'app/models/spotlight/feature_page.rb' + - 'app/models/spotlight/home_page.rb' + - 'app/models/spotlight/page.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -593,13 +485,15 @@ Style/GlobalStdStream: Exclude: - 'lib/tasks/spotlight_tasks.rake' -# Offense count: 1 +# Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedReceivers. # AllowedReceivers: Thread.current Style/HashEachMethods: Exclude: + - 'app/controllers/spotlight/roles_controller.rb' - 'app/models/spotlight/blacklight_configuration.rb' + - 'spec/features/browse_category_spec.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -659,12 +553,6 @@ Style/RedundantInitialize: Exclude: - 'lib/migration/page_language.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantRegexpEscape: - Exclude: - - 'app/models/spotlight/contact_form.rb' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Style/SelectByRegexp: diff --git a/app/services/spotlight/etl/executor.rb b/app/services/spotlight/etl/executor.rb index af2c2d36c..f77c271fb 100644 --- a/app/services/spotlight/etl/executor.rb +++ b/app/services/spotlight/etl/executor.rb @@ -56,7 +56,7 @@ def estimated_size # @private # @yield Logger def with_logger - logger = (context&.logger || Rails.logger) + logger = context&.logger || Rails.logger logger.tagged(pipeline.class) do logger.tagged("#<#{source.class} id=#{source&.id if source.respond_to?(:id)}>") do @logger = logger diff --git a/spec/features/add_contacts_spec.rb b/spec/features/add_contacts_spec.rb index 9b0cb3bdd..a983c7927 100644 --- a/spec/features/add_contacts_spec.rb +++ b/spec/features/add_contacts_spec.rb @@ -40,7 +40,7 @@ expect(page).to have_selector 'div', text: 'Emperor' expect(page).to have_selector 'div', text: 'Rome' expect(page).to have_selector 'div', text: '(555) 555-5555 ext. 12345 (mobile)' - expect(page).not_to have_selector 'img.contact-photo' + expect(page).to have_no_selector 'img.contact-photo' end end diff --git a/spec/features/add_custom_field_metadata_spec.rb b/spec/features/add_custom_field_metadata_spec.rb index aa1dfbf5d..007c34ba8 100644 --- a/spec/features/add_custom_field_metadata_spec.rb +++ b/spec/features/add_custom_field_metadata_spec.rb @@ -67,7 +67,7 @@ it 'has a public toggle' do visit spotlight.exhibit_solr_document_path(exhibit, 'dq287tq6352') - expect(page).not_to have_selector '.blacklight-private' + expect(page).to have_no_selector '.blacklight-private' click_on 'Edit' @@ -83,6 +83,6 @@ click_on 'Save changes' - expect(page).not_to have_selector '.blacklight-private' + expect(page).to have_no_selector '.blacklight-private' end end diff --git a/spec/features/add_items_spec.rb b/spec/features/add_items_spec.rb index 7507d5fad..1698b5c0c 100644 --- a/spec/features/add_items_spec.rb +++ b/spec/features/add_items_spec.rb @@ -81,7 +81,7 @@ it 'does not display the raw documents upload form' do visit spotlight.new_exhibit_resource_path(exhibit) click_link 'Upload raw documents' - expect(page).not_to have_css('form#new_resources_json_upload') + expect(page).to have_no_css('form#new_resources_json_upload') end context 'as an site administrator' do diff --git a/spec/features/autocomplete_typeahead_spec.rb b/spec/features/autocomplete_typeahead_spec.rb index 6f1cf69df..252e60fb9 100644 --- a/spec/features/autocomplete_typeahead_spec.rb +++ b/spec/features/autocomplete_typeahead_spec.rb @@ -12,7 +12,7 @@ visit spotlight.edit_exhibit_appearance_path(exhibit) click_link 'Exhibit masthead' - expect(page).not_to have_css('.leaflet-container') + expect(page).to have_no_css('.leaflet-container') check 'Show background image in masthead' @@ -65,7 +65,7 @@ fill_in_typeahead_field(with: 'gk446cj2442', type: 'featured-image') - expect(page).not_to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/) + expect(page).to have_no_css('[data-panel-image-pagination]', text: /Image 1 of 2/) end end @@ -78,7 +78,7 @@ visit spotlight.edit_exhibit_appearance_path(exhibit) click_link 'Exhibit masthead' - expect(page).not_to have_css('[data-behavior="non-iiif-alert"]', visible: true) + expect(page).to have_no_css('[data-behavior="non-iiif-alert"]', visible: true) fill_in_typeahead_field(with: 'gk446cj2442', type: 'featured-image') diff --git a/spec/features/browse_category_admin_spec.rb b/spec/features/browse_category_admin_spec.rb index 3c3e69149..de11501d0 100644 --- a/spec/features/browse_category_admin_spec.rb +++ b/spec/features/browse_category_admin_spec.rb @@ -157,7 +157,7 @@ click_link('Delete') end expect(page).to have_content('Search was deleted') - expect(page).not_to have_content(search.title) + expect(page).to have_no_content(search.title) end end end diff --git a/spec/features/browse_category_spec.rb b/spec/features/browse_category_spec.rb index 87ea3a854..fd9f0ff30 100644 --- a/spec/features/browse_category_spec.rb +++ b/spec/features/browse_category_spec.rb @@ -22,7 +22,7 @@ expect(page).to have_selector 'h1', text: 'Some Saved Search' end - expect(page).not_to have_selector '.masthead .h2', text: 'Some Saved Search' + expect(page).to have_no_selector '.masthead .h2', text: 'Some Saved Search' end it 'shows the search bar' do @@ -43,7 +43,7 @@ visit spotlight.exhibit_browse_path(exhibit, search) - expect(page).not_to have_selector '.search-query-form' + expect(page).to have_no_selector '.search-query-form' end end end @@ -62,7 +62,7 @@ expect(page).to have_selector '.masthead .h2', text: 'Some Saved Search' within '#main-container' do - expect(page).not_to have_selector 'h1', text: 'Some Saved Search' + expect(page).to have_no_selector 'h1', text: 'Some Saved Search' end expect(page).to have_selector '.masthead small.item-count', text: /\d+ items/ @@ -71,13 +71,13 @@ it 'does not show the search bar' do visit spotlight.exhibit_browse_path(exhibit, search) - expect(page).not_to have_selector '.search-query-form' + expect(page).to have_no_selector '.search-query-form' end it 'does not have breadcrumbs' do visit spotlight.exhibit_browse_path(exhibit, search) - expect(page).not_to have_selector '.breadcrumbs-container' + expect(page).to have_no_selector '.breadcrumbs-container' end end @@ -104,8 +104,8 @@ expect(page).to have_css('#documents.documents-gallery .document', count: 1) within '.document' do - expect(page).not_to have_css('dt') - expect(page).not_to have_css('dd') + expect(page).to have_no_css('dt') + expect(page).to have_no_css('dd') end end end @@ -136,7 +136,7 @@ it 'renders search box' do visit spotlight.exhibit_browse_path(exhibit, search) expect(page).to have_selector '.browse-search-form' - expect(page).not_to have_css '.browse-search-expand' + expect(page).to have_no_css '.browse-search-expand' fill_in 'Search within this browse category', with: 'SEPTENTRIONALE' click_button 'Search within browse category' diff --git a/spec/features/exhibit_masthead_spec.rb b/spec/features/exhibit_masthead_spec.rb index 25748972b..3171651ab 100644 --- a/spec/features/exhibit_masthead_spec.rb +++ b/spec/features/exhibit_masthead_spec.rb @@ -43,7 +43,7 @@ it 'displays a masthead image when one is uploaded and configured' do visit spotlight.exhibit_dashboard_path(exhibit) - expect(page).not_to have_css('.image-masthead') + expect(page).to have_no_css('.image-masthead') within '#sidebar' do click_link 'Appearance' end @@ -68,7 +68,7 @@ it 'does not display an uploaded masthead if configured to not display' do visit spotlight.exhibit_dashboard_path(exhibit) - expect(page).not_to have_css('.image-masthead') + expect(page).to have_no_css('.image-masthead') within '#sidebar' do click_link 'Appearance' end @@ -83,14 +83,14 @@ expect(page).to have_content('The exhibit was successfully updated.') - expect(page).not_to have_css('.image-masthead .background-container') + expect(page).to have_no_css('.image-masthead .background-container') end it 'displays a masthead image when one is uploaded from an exhibit item', js: true do skip "Capyabara and the cropping tool don't play well together.." visit spotlight.exhibit_dashboard_path(exhibit) - expect(page).not_to have_css('.image-masthead') + expect(page).to have_no_css('.image-masthead') within '#sidebar' do click_link 'Appearance' end diff --git a/spec/features/exhibits/administration_spec.rb b/spec/features/exhibits/administration_spec.rb index 41224520a..117184946 100644 --- a/spec/features/exhibits/administration_spec.rb +++ b/spec/features/exhibits/administration_spec.rb @@ -42,7 +42,7 @@ fill_in email_id_0, with: email_address_0 # Additonal blank fields should not exist - expect(page).not_to have_css("input##{email_id_1}") + expect(page).to have_no_css("input##{email_id_1}") # click the + (add contact) button find_by_id('another-email').click # An additional blank field should exist now @@ -88,7 +88,7 @@ end # the page element for the first entry should now be gone, but the second should still be present - expect(page).not_to have_css("##{email_id_0}") + expect(page).to have_no_css("##{email_id_0}") expect(find_field(email_id_1).value).to eq email_address_1 # reload the edit page to confirm deletion from db... @@ -97,7 +97,7 @@ # what was the second address should now be the only one on the page, and should now be # in the first/only form field (form fields are numbered at page load from 0). expect(find_field(email_id_0).value).to eq email_address_1 - expect(page).not_to have_css("##{email_id_1}") + expect(page).to have_no_css("##{email_id_1}") # the hidden input field is what contains the underlying id of the contact for db retrieval expect(find("##{hidden_input_id_0}", visible: false).value).to eq hidden_input_val_1 @@ -117,8 +117,8 @@ # id field that's used to indicate the id of the record to be updated. expect(page).to have_css("##{hidden_input_id_0}~div div.confirmation-status") expect(page).to have_css("##{hidden_input_id_0}~div span.contact-email-delete-wrapper") - expect(page).not_to have_css("##{hidden_input_id_1}~div div.confirmation-status") - expect(page).not_to have_css("##{hidden_input_id_1}~div span.contact-email-delete-wrapper") + expect(page).to have_no_css("##{hidden_input_id_1}~div div.confirmation-status") + expect(page).to have_no_css("##{hidden_input_id_1}~div span.contact-email-delete-wrapper") expect(find_all('.confirmation-status').length).to eq 1 expect(find_all('.contact-email-delete-wrapper').length).to eq 1 end diff --git a/spec/features/exhibits/language_create_edit_spec.rb b/spec/features/exhibits/language_create_edit_spec.rb index 688f68813..56f15a704 100644 --- a/spec/features/exhibits/language_create_edit_spec.rb +++ b/spec/features/exhibits/language_create_edit_spec.rb @@ -52,7 +52,7 @@ expect(page).to have_css '.flash_messages', text: 'The language was deleted.' within '#language' do expect(page).to have_content 'No languages have been added for translation. To add a language, make a selection above.' - expect(page).not_to have_css 'table' + expect(page).to have_no_css 'table' end end end diff --git a/spec/features/exhibits/translation_editing_spec.rb b/spec/features/exhibits/translation_editing_spec.rb index f1e748f5f..c3115a39c 100644 --- a/spec/features/exhibits/translation_editing_spec.rb +++ b/spec/features/exhibits/translation_editing_spec.rb @@ -43,7 +43,7 @@ expect(page).to have_css '.translation-complete' end within '.translation-basic-settings-description' do - expect(page).not_to have_css '.translation-complete' + expect(page).to have_no_css '.translation-complete' end end end @@ -75,10 +75,10 @@ expect(page).to have_css '.translation-complete' end within '.translation-main-menu-curated_features' do - expect(page).not_to have_css '.translation-complete' + expect(page).to have_no_css '.translation-complete' end within '.translation-main-menu-about' do - expect(page).not_to have_css '.translation-complete' + expect(page).to have_no_css '.translation-complete' end I18n.locale = :fr expect(exhibit.main_navigations.browse.label).to eq 'parcourir ceci!' @@ -442,7 +442,7 @@ # home page should have a disabled checkbox expect(page).to have_css('.translation-home-page-settings input[type="checkbox"][disabled]') # feature page does not have a translation, so don't use checkbox - expect(page).not_to have_css('.translation-feature-page-settings input[type="checkbox"]') + expect(page).to have_no_css('.translation-feature-page-settings input[type="checkbox"]') # about page should have a checked checkbox expect(page).to have_css('.translation-about-page-settings input[type="checkbox"][checked]') end diff --git a/spec/features/feature_page_spec.rb b/spec/features/feature_page_spec.rb index a43f60770..c674a7e8b 100644 --- a/spec/features/feature_page_spec.rb +++ b/spec/features/feature_page_spec.rb @@ -70,8 +70,8 @@ it 'does not be present' do visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page) - expect(page).not_to have_css('#sidebar') - expect(page).not_to have_content(child_feature_page.title) + expect(page).to have_no_css('#sidebar') + expect(page).to have_no_content(child_feature_page.title) end end end @@ -149,7 +149,7 @@ # and then open the edit page again visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) - expect(page).not_to have_css '.alert' + expect(page).to have_no_css '.alert' end end end diff --git a/spec/features/home_page_spec.rb b/spec/features/home_page_spec.rb index 8a8537686..5161b3318 100644 --- a/spec/features/home_page_spec.rb +++ b/spec/features/home_page_spec.rb @@ -96,7 +96,7 @@ it 'does not display the facet sidebar' do visit spotlight.exhibit_home_page_path(exhibit) - expect(page).not_to have_css('#sidebar') + expect(page).to have_no_css('#sidebar') end end end diff --git a/spec/features/item_admin_spec.rb b/spec/features/item_admin_spec.rb index 6767ec515..0de6dcd75 100644 --- a/spec/features/item_admin_spec.rb +++ b/spec/features/item_admin_spec.rb @@ -12,7 +12,7 @@ describe 'admin' do it "does not have a 'Save this search' button" do visit spotlight.admin_exhibit_catalog_path(exhibit) - expect(page).not_to have_css('button', text: 'Save this search') + expect(page).to have_no_css('button', text: 'Save this search') end it 'has catalog items' do @@ -40,7 +40,7 @@ it "toggles the 'blacklight-private' label", default_max_wait_time: 5, js: true do visit spotlight.admin_exhibit_catalog_path(exhibit) # The label should be toggled when the checkbox is clicked - expect(page).not_to have_css('tr.blacklight-private') + expect(page).to have_no_css('tr.blacklight-private') within 'tr[itemscope]:first-child' do find("input.toggle-visibility[type='checkbox']").click end @@ -52,7 +52,7 @@ within 'tr[itemscope]:first-child' do find("input.toggle-visibility[type='checkbox']").click end - expect(page).not_to have_css('tr.blacklight-private') + expect(page).to have_no_css('tr.blacklight-private') end end end diff --git a/spec/features/javascript/blocks/browse_group_categories_block_spec.rb b/spec/features/javascript/blocks/browse_group_categories_block_spec.rb index c4a8ace20..69df1b7d5 100644 --- a/spec/features/javascript/blocks/browse_group_categories_block_spec.rb +++ b/spec/features/javascript/blocks/browse_group_categories_block_spec.rb @@ -44,9 +44,9 @@ expect(page).to have_css 'h2', text: 'Pets' expect(page).to have_css '.category-title', text: 'All of the good dogs' - expect(page).not_to have_css '.category-title', text: 'All of the good tigers' + expect(page).to have_no_css '.category-title', text: 'All of the good tigers' find('[data-controls="next"]').click - expect(page).not_to have_css '.category-title', text: 'All of the good dogs' + expect(page).to have_no_css '.category-title', text: 'All of the good dogs' expect(page).to have_css '.category-title', text: 'All of the good tigers' end diff --git a/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb b/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb index b9cf8cec4..07224d092 100644 --- a/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +++ b/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb @@ -30,7 +30,7 @@ save_page # Documents should exist - expect(page).not_to have_css('.category-title', text: search1.title) + expect(page).to have_no_css('.category-title', text: search1.title) expect(page).to have_css('.category-title', text: search2.title) expect(page).to have_css('.item-count', text: /\d+ items/i) end @@ -41,6 +41,6 @@ fill_in_typeahead_field with: 'Title1' save_page - expect(page).not_to have_css('.item-count', text: /\d+ items/i) + expect(page).to have_no_css('.item-count', text: /\d+ items/i) end end diff --git a/spec/features/javascript/blocks/link_to_search_block_spec.rb b/spec/features/javascript/blocks/link_to_search_block_spec.rb index 9c594fe07..00f539596 100644 --- a/spec/features/javascript/blocks/link_to_search_block_spec.rb +++ b/spec/features/javascript/blocks/link_to_search_block_spec.rb @@ -30,7 +30,7 @@ save_page # Documents should exist - expect(page).not_to have_css('.category-title', text: search1.title) + expect(page).to have_no_css('.category-title', text: search1.title) expect(page).to have_css('.category-title', text: search2.title) expect(page).to have_css('.item-count', text: /\d+ items/i) end @@ -41,6 +41,6 @@ fill_in_typeahead_field with: 'Title1' save_page - expect(page).not_to have_css('.item-count', text: /\d+ items/i) + expect(page).to have_no_css('.item-count', text: /\d+ items/i) end end diff --git a/spec/features/javascript/blocks/search_result_block_spec.rb b/spec/features/javascript/blocks/search_result_block_spec.rb index d6074d519..5861b2cee 100644 --- a/spec/features/javascript/blocks/search_result_block_spec.rb +++ b/spec/features/javascript/blocks/search_result_block_spec.rb @@ -30,13 +30,13 @@ save_page - expect(page).not_to have_content 'per page' - expect(page).not_to have_content 'Sort by' + expect(page).to have_no_content 'per page' + expect(page).to have_no_content 'Sort by' # The two configured view types should be # present and the one not selected should not be within('.view-type-group') do - expect(page).not_to have_css('.view-type-list') + expect(page).to have_no_css('.view-type-list') expect(page).to have_css('.view-type-gallery') expect(page).to have_css('.view-type-slideshow') end diff --git a/spec/features/javascript/blocks/solr_documents_block_spec.rb b/spec/features/javascript/blocks/solr_documents_block_spec.rb index c175c0c56..ca8de9742 100644 --- a/spec/features/javascript/blocks/solr_documents_block_spec.rb +++ b/spec/features/javascript/blocks/solr_documents_block_spec.rb @@ -38,7 +38,7 @@ # verify that the item + image widget is displaying an image from the document. within(:css, '.items-block', visible: true) do expect(page).to have_css('.img-thumbnail') - expect(page).not_to have_css('.title') + expect(page).to have_no_css('.title') end end @@ -102,7 +102,7 @@ expect(page).to have_selector '.items-block .box', count: 1, visible: true expect(page).to have_content '[World map]' - expect(page).not_to have_content "L'AMERIQUE" + expect(page).to have_no_content "L'AMERIQUE" visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page) # display the title as the primary caption @@ -112,7 +112,7 @@ save_page expect(page).to have_selector '.items-block .box', count: 1, visible: true - expect(page).not_to have_content '[World map]' + expect(page).to have_no_content '[World map]' end it 'allows you to optionally display captions with the image', js: true do diff --git a/spec/features/javascript/blocks/uploaded_items_block_spec.rb b/spec/features/javascript/blocks/uploaded_items_block_spec.rb index d6a783d0a..d0831ad24 100644 --- a/spec/features/javascript/blocks/uploaded_items_block_spec.rb +++ b/spec/features/javascript/blocks/uploaded_items_block_spec.rb @@ -19,7 +19,7 @@ content_editable = find('.st-text-block') content_editable.set(text) - expect(page).not_to have_css('.dd-list li') + expect(page).to have_no_css('.dd-list li') attach_file('uploaded_item_url', fixture_file1) expect(page).to have_css('.dd-list li', count: 1) diff --git a/spec/features/javascript/edit_in_place_spec.rb b/spec/features/javascript/edit_in_place_spec.rb index 4f799573b..320494e30 100644 --- a/spec/features/javascript/edit_in_place_spec.rb +++ b/spec/features/javascript/edit_in_place_spec.rb @@ -18,9 +18,9 @@ within('.feature_pages_admin') do expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false) - expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') + expect(page).to have_no_css('#exhibit_feature_pages_attributes_0_title[type="text"]') click_link('My New Feature Page') - expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]') + expect(page).to have_no_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]') expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') fill_in 'exhibit_feature_pages_attributes_0_title', with: 'My Newer Feature Page' end @@ -28,7 +28,7 @@ expect(page).to have_content('Feature pages were successfully updated.') expect(page).to have_css('h3', text: 'My Newer Feature Page') - expect(page).not_to have_css('h3', text: 'My New Feature Page') + expect(page).to have_no_css('h3', text: 'My New Feature Page') end it 'rejects blank values' do @@ -44,9 +44,9 @@ within('.feature_pages_admin') do expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false) - expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') + expect(page).to have_no_css('#exhibit_feature_pages_attributes_0_title[type="text"]') click_link('My New Feature Page') - expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]') + expect(page).to have_no_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]') expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') fill_in 'exhibit_feature_pages_attributes_0_title', with: '' # blur out of the now-emptytitle field @@ -54,7 +54,7 @@ field.native.send_keys :tab expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false) - expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') + expect(page).to have_no_css('#exhibit_feature_pages_attributes_0_title[type="text"]') expect(page).to have_css('h3', text: 'My New Feature Page') end end @@ -72,9 +72,9 @@ within('#nested-navigation') do expect(page).to have_css("#exhibit_main_navigations_attributes_0_label[type='hidden']", visible: false) - expect(page).not_to have_css("#exhibit_main_navigations_attributes_0_label[type='text']") + expect(page).to have_no_css("#exhibit_main_navigations_attributes_0_label[type='text']") click_link('Curated features') - expect(page).not_to have_css("#exhibit_main_navigations_attributes_0_label[type='hidden']") + expect(page).to have_no_css("#exhibit_main_navigations_attributes_0_label[type='hidden']") expect(page).to have_css("#exhibit_main_navigations_attributes_0_label[type='text']") fill_in 'exhibit_main_navigations_attributes_0_label', with: 'My Page Label' end diff --git a/spec/features/javascript/feature_page_admin_spec.rb b/spec/features/javascript/feature_page_admin_spec.rb index 0309d1181..602d0c82a 100644 --- a/spec/features/javascript/feature_page_admin_spec.rb +++ b/spec/features/javascript/feature_page_admin_spec.rb @@ -62,7 +62,7 @@ page.dismiss_confirm do click_link 'Cancel' end - expect(page).not_to have_selector 'a', text: 'Edit' + expect(page).to have_no_selector 'a', text: 'Edit' end it 'stays in curation mode if a user has unsaved contenteditable data' do @@ -75,7 +75,7 @@ page.accept_confirm do click_link 'Cancel' end - expect(page).not_to have_selector 'a', text: 'Edit' + expect(page).to have_no_selector 'a', text: 'Edit' end it 'does not update the pages list when the user has unsaved changes' do @@ -98,7 +98,7 @@ click_link 'Home' end end - expect(page).not_to have_content('Feature pages were successfully updated.') + expect(page).to have_no_content('Feature pages were successfully updated.') # NOTE: get flash message about unsaved changes expect(page).to have_content('Welcome to your new exhibit') diff --git a/spec/features/javascript/home_page_edit_spec.rb b/spec/features/javascript/home_page_edit_spec.rb index f749e123e..d9d75e73e 100644 --- a/spec/features/javascript/home_page_edit_spec.rb +++ b/spec/features/javascript/home_page_edit_spec.rb @@ -10,7 +10,7 @@ visit spotlight.edit_exhibit_home_page_path(exhibit) click_add_widget expect(page).to have_css("[data-type='solr_documents']", visible: true) - expect(page).not_to have_css("[data-type='search_results']", visible: true) + expect(page).to have_no_css("[data-type='search_results']", visible: true) end it 'correctly saves a list widget' do diff --git a/spec/features/javascript/locale_selector_spec.rb b/spec/features/javascript/locale_selector_spec.rb index 9c04a9c11..1dee33dda 100644 --- a/spec/features/javascript/locale_selector_spec.rb +++ b/spec/features/javascript/locale_selector_spec.rb @@ -59,7 +59,7 @@ click_link 'EspaƱol' end - expect(page).not_to have_css('input[placeholder="Search..."]') + expect(page).to have_no_css('input[placeholder="Search..."]') expect(page).to have_css('input[placeholder="Buscar..."]') end end diff --git a/spec/features/javascript/metadata_admin_spec.rb b/spec/features/javascript/metadata_admin_spec.rb index 65c6ecb6e..1cd14d2e9 100644 --- a/spec/features/javascript/metadata_admin_spec.rb +++ b/spec/features/javascript/metadata_admin_spec.rb @@ -10,19 +10,19 @@ it 'deselects all checkboxes when all are selected' do visit spotlight.edit_exhibit_metadata_configuration_path exhibit # No checkboxes should be unchecked - expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") + expect(page).to have_no_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") within('tr th:nth-child(2)') do click_button 'Deselect all' expect(page).to have_css('button', text: 'Select all', visible: true) end # No checkboxes should be checked - expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:checked") + expect(page).to have_no_css("tr td:nth-child(2) input[type='checkbox']:checked") end it 'selects all checkboxes when any are unselected' do visit spotlight.edit_exhibit_metadata_configuration_path exhibit # No checkboxes should be unchecked - expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") + expect(page).to have_no_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") first_button_area = find('tr th:nth-child(2)') within first_button_area do expect(page).to have_css('button', text: 'Deselect all') @@ -35,7 +35,7 @@ click_button 'Select all' end # No checkboxes should be unchecked - expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") + expect(page).to have_no_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") end end end diff --git a/spec/features/javascript/multi_image_select_spec.rb b/spec/features/javascript/multi_image_select_spec.rb index 1162b7258..8f8e59ea1 100644 --- a/spec/features/javascript/multi_image_select_spec.rb +++ b/spec/features/javascript/multi_image_select_spec.rb @@ -26,7 +26,7 @@ visit spotlight.exhibit_feature_page_path(exhibit, feature_page) expect(page).to have_css("[data-id='xd327cm9378']") expect(page).to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378/xd327cm9378_05_0001/full/!400,400/0/default.jpg']") - expect(page).not_to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378/xd327cm9378_05_0002/full/!400,400/0/default.jpg']") + expect(page).to have_no_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378/xd327cm9378_05_0002/full/!400,400/0/default.jpg']") click_link('Edit') @@ -44,7 +44,7 @@ save_page expect(page).to have_css("[data-id='xd327cm9378']") - expect(page).not_to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378/xd327cm9378_05_0001/full/!400,400/0/default.jpg']") + expect(page).to have_no_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378/xd327cm9378_05_0001/full/!400,400/0/default.jpg']") expect(page).to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378/xd327cm9378_05_0002/full/!400,400/0/default.jpg']") end end diff --git a/spec/features/javascript/roles_admin_spec.rb b/spec/features/javascript/roles_admin_spec.rb index 4ab15aa86..95c70983a 100644 --- a/spec/features/javascript/roles_admin_spec.rb +++ b/spec/features/javascript/roles_admin_spec.rb @@ -24,7 +24,7 @@ end it 'persists invited users to the exhibits user list' do - expect(page).not_to have_css('.badge-warning pending-label', text: 'pending', visible: true) + expect(page).to have_no_css('.badge-warning pending-label', text: 'pending', visible: true) click_link 'Add a new user' fill_in 'User key', with: 'user@example.com' diff --git a/spec/features/javascript/search_config_admin_spec.rb b/spec/features/javascript/search_config_admin_spec.rb index b0ff5f4d2..52ff8bb9c 100644 --- a/spec/features/javascript/search_config_admin_spec.rb +++ b/spec/features/javascript/search_config_admin_spec.rb @@ -19,7 +19,7 @@ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true) - expect(page).not_to have_css 'select#search_field' + expect(page).to have_no_css 'select#search_field' end it 'allows the curator to update search field options' do @@ -29,9 +29,9 @@ within('#nested-search-fields') do expect(page).to have_css("#blacklight_configuration_search_fields_title_label[type='hidden']", visible: false) - expect(page).not_to have_css("#blacklight_configuration_search_fields_title_label[type='text']") + expect(page).to have_no_css("#blacklight_configuration_search_fields_title_label[type='text']") click_link('Title') - expect(page).not_to have_css("#blacklight_configuration_search_fields_title_label[type='hidden']") + expect(page).to have_no_css("#blacklight_configuration_search_fields_title_label[type='hidden']") expect(page).to have_css("#blacklight_configuration_search_fields_title_label[type='text']") fill_in 'blacklight_configuration_search_fields_title_label', with: 'My Title Label' end @@ -51,7 +51,7 @@ click_link 'Facets' facet = find('.edit-in-place', text: 'Genre') - expect(page).not_to have_content('Topic') + expect(page).to have_no_content('Topic') expect(page).to have_css("input##{input_id}", visible: false) facet.click @@ -65,7 +65,7 @@ expect(page).to have_css('.alert', text: 'The exhibit was successfully updated.', visible: true) - expect(page).not_to have_content('Genre') + expect(page).to have_no_content('Genre') expect(page).to have_content('Topic') end @@ -119,9 +119,9 @@ within('#nested-sort-fields') do expect(page).to have_css("#blacklight_configuration_sort_fields_title_label[type='hidden']", visible: false) - expect(page).not_to have_css("#blacklight_configuration_sort_fields_title_label[type='text']") + expect(page).to have_no_css("#blacklight_configuration_sort_fields_title_label[type='text']") click_link('title') - expect(page).not_to have_css("#blacklight_configuration_sort_fields_title_label[type='hidden']") + expect(page).to have_no_css("#blacklight_configuration_sort_fields_title_label[type='hidden']") expect(page).to have_css("#blacklight_configuration_sort_fields_title_label[type='text']") fill_in 'blacklight_configuration_sort_fields_title_label', with: 'My Title Label' end diff --git a/spec/features/javascript/search_context_spec.rb b/spec/features/javascript/search_context_spec.rb index 9af264aac..3d290ea93 100644 --- a/spec/features/javascript/search_context_spec.rb +++ b/spec/features/javascript/search_context_spec.rb @@ -34,7 +34,7 @@ # verify that the item + image widget is displaying an image from the document. within(:css, '.items-block') do expect(page).to have_css('.img-thumbnail') - expect(page).not_to have_css('.title') + expect(page).to have_no_css('.title') end find('.items-block a').click @@ -63,7 +63,7 @@ # verify that the item + image widget is displaying an image from the document. within(:css, '.items-block') do expect(page).to have_css('.img-thumbnail') - expect(page).not_to have_css('.title') + expect(page).to have_no_css('.title') end find('.items-block a').click diff --git a/spec/features/main_navigation_spec.rb b/spec/features/main_navigation_spec.rb index e654dc9a3..7613cd519 100644 --- a/spec/features/main_navigation_spec.rb +++ b/spec/features/main_navigation_spec.rb @@ -50,7 +50,7 @@ about_nav.display = false about_nav.save visit spotlight.exhibit_path(exhibit) - expect(page).not_to have_css('.navbar-nav li', text: 'New About Label') + expect(page).to have_no_css('.navbar-nav li', text: 'New About Label') about_nav = exhibit.main_navigations.about about_nav.display = true about_nav.save @@ -68,7 +68,7 @@ within '.main_navigation_admin' do within all('li').first do - expect(page).not_to have_css('button.restore-default', visible: true) + expect(page).to have_no_css('button.restore-default', visible: true) end within all('li').last do diff --git a/spec/features/report_a_problem_spec.rb b/spec/features/report_a_problem_spec.rb index f942de6aa..a43a37b9d 100644 --- a/spec/features/report_a_problem_spec.rb +++ b/spec/features/report_a_problem_spec.rb @@ -6,7 +6,7 @@ it 'does not have a header link' do visit root_path - expect(page).not_to have_content 'Feedback' + expect(page).to have_no_content 'Feedback' end describe 'when emails are setup' do diff --git a/spec/features/site_masthead_spec.rb b/spec/features/site_masthead_spec.rb index eb1b0cf47..e43d6e02c 100644 --- a/spec/features/site_masthead_spec.rb +++ b/spec/features/site_masthead_spec.rb @@ -56,7 +56,7 @@ it 'displays a masthead image when one is uploaded and configured' do visit spotlight.edit_site_path - expect(page).not_to have_css('.image-masthead') + expect(page).to have_no_css('.image-masthead') click_link 'Site masthead' @@ -76,7 +76,7 @@ it 'does not display an uploaded masthead if configured to not display' do visit spotlight.edit_site_path - expect(page).not_to have_css('.image-masthead') + expect(page).to have_no_css('.image-masthead') click_link 'Site masthead' @@ -86,6 +86,6 @@ click_button 'Save changes' expect(page).to have_content('The site was successfully updated.') - expect(page).not_to have_css('.image-masthead .background-container') + expect(page).to have_no_css('.image-masthead .background-container') end end diff --git a/spec/features/site_users_management_spec.rb b/spec/features/site_users_management_spec.rb index f00b876cf..6e5cb628f 100644 --- a/spec/features/site_users_management_spec.rb +++ b/spec/features/site_users_management_spec.rb @@ -20,7 +20,7 @@ expect(page).to have_css('div#admins_curators', text: user.email) expect(page).to have_css('div#admins_curators', text: exhibit_admin.email) expect(page).to have_css('div#admins_curators', text: exhibit_curator.email) - expect(page).not_to have_css('div#admins_curators', text: existing_user.email) + expect(page).to have_no_css('div#admins_curators', text: existing_user.email) expect(page).to have_css('button.copy-email-addresses') end end diff --git a/spec/helpers/spotlight/crud_link_helpers_spec.rb b/spec/helpers/spotlight/crud_link_helpers_spec.rb index d8475016b..b036a3ab1 100644 --- a/spec/helpers/spotlight/crud_link_helpers_spec.rb +++ b/spec/helpers/spotlight/crud_link_helpers_spec.rb @@ -157,7 +157,7 @@ allow(helper).to receive(:current_page?).with(root_url).and_return(true) rendered = Capybara.string(helper.nav_link('Some link', root_url, active: false)) - expect(rendered).not_to have_css('.nav-link.active') + expect(rendered).to have_no_css('.nav-link.active') end end end diff --git a/spec/helpers/spotlight/title_helper_spec.rb b/spec/helpers/spotlight/title_helper_spec.rb index 8f32baf1c..4db962ca8 100644 --- a/spec/helpers/spotlight/title_helper_spec.rb +++ b/spec/helpers/spotlight/title_helper_spec.rb @@ -25,7 +25,7 @@ title = helper.page_title('Section') expect(title).to have_selector 'h1', text: 'Section' - expect(title).not_to have_selector 'h1 small' + expect(title).to have_no_selector 'h1 small' title = helper.instance_variable_get(:@page_title) expect(title).to eq 'Section | Application' diff --git a/spec/models/spotlight/page_spec.rb b/spec/models/spotlight/page_spec.rb index 0165efccb..346c83461 100644 --- a/spec/models/spotlight/page_spec.rb +++ b/spec/models/spotlight/page_spec.rb @@ -86,7 +86,7 @@ def self.parse(*_args) it 'does not have content when the page is empty' do page.content = [] - expect(page).not_to have_content + expect(page).not_to have_content # rubocop:disable Capybara/NegationMatcher end it 'has content when the page has a widget' do diff --git a/spec/models/spotlight/solr_document_sidecar_spec.rb b/spec/models/spotlight/solr_document_sidecar_spec.rb index 845ffde96..f3b66b0f2 100644 --- a/spec/models/spotlight/solr_document_sidecar_spec.rb +++ b/spec/models/spotlight/solr_document_sidecar_spec.rb @@ -14,7 +14,7 @@ end its(:to_solr) { is_expected.to include id: 'doc_id' } - its(:to_solr) { is_expected.to include "exhibit_#{exhibit.slug}_public_bsi".to_sym => true } + its(:to_solr) { is_expected.to include "exhibit_#{exhibit.slug}_public_bsi": true } its(:to_solr) { is_expected.to include 'a_tesim', 'b_tesim', 'c_tesim' } context 'with an uploaded item' do diff --git a/spec/support/features/test_features_helpers.rb b/spec/support/features/test_features_helpers.rb index e9c3d934e..d8f56063e 100644 --- a/spec/support/features/test_features_helpers.rb +++ b/spec/support/features/test_features_helpers.rb @@ -60,7 +60,7 @@ def save_page EOF click_button('Save changes') # verify that the page was created - expect(page).not_to have_selector('.alert-danger') + expect(page).to have_no_selector('.alert-danger') expect(page).to have_selector('.alert-info', text: 'page was successfully updated') end diff --git a/spec/views/shared/_exhibit_navbar.html.erb_spec.rb b/spec/views/shared/_exhibit_navbar.html.erb_spec.rb index 5f551f768..00ad88f81 100644 --- a/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +++ b/spec/views/shared/_exhibit_navbar.html.erb_spec.rb @@ -53,13 +53,13 @@ it 'does not display links to feature pages if none are defined' do render - expect(response).not_to have_link 'Curated Features' + expect(response).to have_no_link 'Curated Features' end it 'does not display links to feature pages that are not published' do unpublished_feature_page render - expect(response).not_to have_link 'Curated Features' + expect(response).to have_no_link 'Curated Features' end it "links to the browse index if there's a published search" do @@ -77,13 +77,13 @@ it 'does not link to the browse index if no categories are defined' do render - expect(response).not_to have_link 'Browse' + expect(response).to have_no_link 'Browse' end it 'does not link to the browse index if only private categories are defined' do FactoryBot.create(:search, exhibit: current_exhibit) render - expect(response).not_to have_link 'Browse' + expect(response).to have_no_link 'Browse' end it 'links to the about page' do @@ -94,13 +94,13 @@ it 'does not link to the about page if no about page exists' do render - expect(response).not_to have_link 'About' + expect(response).to have_no_link 'About' end it 'does not to the about page if none are published' do unpublished_about_page render - expect(response).not_to have_link 'About' + expect(response).to have_no_link 'About' end it "marks the about button as active if we're on an about page" do @@ -119,7 +119,7 @@ it 'does not include the search bar when the exhibit is not searchable' do expect(current_exhibit).to receive(:searchable?).and_return(false) render - expect(response).not_to have_content 'Search Bar' + expect(response).to have_no_content 'Search Bar' end it 'does not include any navigation menu items that are not configured' do diff --git a/spec/views/shared/_masthead.html.erb_spec.rb b/spec/views/shared/_masthead.html.erb_spec.rb index 6ae29c67b..e1954a02c 100644 --- a/spec/views/shared/_masthead.html.erb_spec.rb +++ b/spec/views/shared/_masthead.html.erb_spec.rb @@ -26,7 +26,7 @@ it 'does not include the subtitle' do render - expect(rendered).not_to have_selector 'small' + expect(rendered).to have_no_selector 'small' end end diff --git a/spec/views/shared/_user_util_links.html.erb_spec.rb b/spec/views/shared/_user_util_links.html.erb_spec.rb index 923f3ad82..7c43b87db 100644 --- a/spec/views/shared/_user_util_links.html.erb_spec.rb +++ b/spec/views/shared/_user_util_links.html.erb_spec.rb @@ -29,7 +29,7 @@ it 'does not render the feedback link' do render - expect(rendered).not_to have_link 'Feedback' + expect(rendered).to have_no_link 'Feedback' end end @@ -39,7 +39,7 @@ it 'renders the links' do render expect(rendered).to have_link 'Feedback' - expect(rendered).not_to have_link 'Exhibit dashboard' + expect(rendered).to have_no_link 'Exhibit dashboard' expect(rendered).to have_link 'Sign out' end end diff --git a/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb b/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb index cd705258c..d3f332e70 100644 --- a/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +++ b/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb @@ -10,7 +10,7 @@ describe 'when a user cannot edit' do it 'does not render an ordered list of steps' do - expect(rendered).not_to have_css('ol') + expect(rendered).to have_no_css('ol') end end diff --git a/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb b/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb index b9f987247..c8d60ea6a 100644 --- a/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +++ b/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb @@ -19,6 +19,6 @@ expect(rendered).to have_selector 'ul.sidenav li:nth-child(2) a', text: 'One' expect(rendered).to have_link 'Three', href: "/spotlight/#{exhibit.slug}/about/three" expect(rendered).to have_link 'One', href: "/spotlight/#{exhibit.slug}/about/one" - expect(rendered).not_to have_link 'Two' + expect(rendered).to have_no_link 'Two' end end diff --git a/spec/views/spotlight/about_pages/index.html.erb_spec.rb b/spec/views/spotlight/about_pages/index.html.erb_spec.rb index 5870baf1a..2615a5aca 100644 --- a/spec/views/spotlight/about_pages/index.html.erb_spec.rb +++ b/spec/views/spotlight/about_pages/index.html.erb_spec.rb @@ -62,7 +62,7 @@ allow(view).to receive(:disable_save_pages_button?).and_return(false) assign(:pages, [{}]) render - expect(rendered).not_to have_selector 'button[disabled]', text: 'Save changes' + expect(rendered).to have_no_selector 'button[disabled]', text: 'Save changes' expect(rendered).to have_selector 'button', text: 'Save changes' end end diff --git a/spec/views/spotlight/browse/show.html.erb_spec.rb b/spec/views/spotlight/browse/show.html.erb_spec.rb index 15cf86258..10f1e14cc 100644 --- a/spec/views/spotlight/browse/show.html.erb_spec.rb +++ b/spec/views/spotlight/browse/show.html.erb_spec.rb @@ -25,8 +25,8 @@ it 'does not have the heading and item count when there is a current search masthead' do allow(view).to receive_messages(resource_masthead?: true) render - expect(response).not_to have_selector 'h1', text: search.title - expect(response).not_to have_selector '.item-count', text: "#{search.count} items" + expect(response).to have_no_selector 'h1', text: search.title + expect(response).to have_no_selector '.item-count', text: "#{search.count} items" end it 'has an edit button' do @@ -39,7 +39,7 @@ allow(search).to receive_messages(long_description: 'Long description') render expect(response).to have_selector '.long-description-text p', text: search.long_description - expect(response).not_to have_selector '.very-long-description-text' + expect(response).to have_no_selector '.very-long-description-text' end it 'adds markup for very long descriptions' do diff --git a/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb b/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb index db861469d..a3374cb0f 100644 --- a/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +++ b/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb @@ -30,10 +30,10 @@ it 'does not have special metadata editing fields for non-uploaded resources' do render - expect(rendered).not_to have_field 'full_title_tesim label' - expect(rendered).not_to have_field 'spotlight_upload_description_tesim label' - expect(rendered).not_to have_field 'spotlight_upload_attribution_tesim label' - expect(rendered).not_to have_field 'spotlight_upload_date_tesim label' + expect(rendered).to have_no_field 'full_title_tesim label' + expect(rendered).to have_no_field 'spotlight_upload_description_tesim label' + expect(rendered).to have_no_field 'spotlight_upload_attribution_tesim label' + expect(rendered).to have_no_field 'spotlight_upload_date_tesim label' end it 'has special metadata fields for an uploaded resource' do diff --git a/spec/views/spotlight/catalog/admin.html.erb_spec.rb b/spec/views/spotlight/catalog/admin.html.erb_spec.rb index 2308d866e..2c142278e 100644 --- a/spec/views/spotlight/catalog/admin.html.erb_spec.rb +++ b/spec/views/spotlight/catalog/admin.html.erb_spec.rb @@ -34,6 +34,6 @@ it "does not render the 'add items' link if no repository sources are configured" do allow(Spotlight::Engine.config).to receive(:resource_partials).and_return([]) render - expect(rendered).not_to have_link 'Add items' + expect(rendered).to have_no_link 'Add items' end end diff --git a/spec/views/spotlight/exhibits/_form.html.erb_spec.rb b/spec/views/spotlight/exhibits/_form.html.erb_spec.rb index 11eb46f03..51a95fb04 100644 --- a/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +++ b/spec/views/spotlight/exhibits/_form.html.erb_spec.rb @@ -17,8 +17,8 @@ it 'allows an editable title' do render expect(rendered).to have_selector 'input[name="exhibit[title]"]' - expect(rendered).not_to have_selector 'input[name="exhibit[title]"][disabled="disabled"]' - expect(rendered).not_to have_content 'This field is not editable in the current language. Switch to the default language to edit it.' + expect(rendered).to have_no_selector 'input[name="exhibit[title]"][disabled="disabled"]' + expect(rendered).to have_no_content 'This field is not editable in the current language. Switch to the default language to edit it.' end end diff --git a/spec/views/spotlight/exhibits/index.html.erb_spec.rb b/spec/views/spotlight/exhibits/index.html.erb_spec.rb index b0a843c8f..a80ba7fa9 100644 --- a/spec/views/spotlight/exhibits/index.html.erb_spec.rb +++ b/spec/views/spotlight/exhibits/index.html.erb_spec.rb @@ -26,7 +26,7 @@ expect(rendered).to have_selector('.exhibit-card', count: 2) expect(rendered).to have_text exhibit_a.title expect(rendered).to have_text exhibit_b.title - expect(rendered).not_to have_text exhibit_c.title + expect(rendered).to have_no_text exhibit_c.title expect(rendered).not_to include 'Private exhibits' end @@ -34,19 +34,19 @@ it 'does not include the tab bar' do render - expect(rendered).not_to have_selector '.nav-tabs' + expect(rendered).to have_no_selector '.nav-tabs' end it 'does not include tags controls' do render - expect(rendered).not_to have_selector '.tags' + expect(rendered).to have_no_selector '.tags' end it 'does not include pagination controls' do render - expect(rendered).not_to have_selector '.pager' + expect(rendered).to have_no_selector '.pager' end context 'with tagged exhibits' do @@ -95,7 +95,7 @@ render expect(rendered).to have_selector '.nav-tabs' - expect(rendered).not_to have_link 'Unpublished exhibits' + expect(rendered).to have_no_link 'Unpublished exhibits' end end diff --git a/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb b/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb index aef49a1e4..d34f2e7f7 100644 --- a/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +++ b/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb @@ -10,7 +10,7 @@ describe 'when a user cannot edit' do it 'does not render an ordered list of steps' do - expect(rendered).not_to have_css('ol') + expect(rendered).to have_no_css('ol') end end diff --git a/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb b/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb index b0d078908..045d36903 100644 --- a/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +++ b/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb @@ -26,8 +26,8 @@ expect(rendered).to have_selector 'ol.sidenav li:nth-child(2) a', text: 'Three' expect(rendered).to have_selector 'li a', text: 'Two' # a different parent page expect(rendered).to have_link 'Four' # different parent - expect(rendered).not_to have_link 'Six' # not published - expect(rendered).not_to have_link 'Seven' # different exhibit + expect(rendered).to have_no_link 'Six' # not published + expect(rendered).to have_no_link 'Seven' # different exhibit end it 'renders a list of pages from a child page' do @@ -40,6 +40,6 @@ expect(rendered).to have_selector 'ol.sidenav li:nth-child(2) a', text: 'Three' expect(rendered).to have_content 'Two' # not selected page expect(rendered).to have_link 'Four' # different parent - expect(rendered).not_to have_link 'Six' # not published + expect(rendered).to have_no_link 'Six' # not published end end diff --git a/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb b/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb index b7116e815..95fde3c5c 100644 --- a/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +++ b/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb @@ -22,7 +22,7 @@ it 'does not have a list item with a link to add items when there are no resource partials configured' do allow(Spotlight::Engine.config).to receive_messages(resource_partials: []) render - expect(rendered).not_to have_css('li a', text: 'Curation > Items') + expect(rendered).to have_no_css('li a', text: 'Curation > Items') end end end diff --git a/spec/views/spotlight/pages/edit.html.erb_spec.rb b/spec/views/spotlight/pages/edit.html.erb_spec.rb index 2534f0574..7518bf060 100644 --- a/spec/views/spotlight/pages/edit.html.erb_spec.rb +++ b/spec/views/spotlight/pages/edit.html.erb_spec.rb @@ -38,7 +38,7 @@ render - expect(rendered).not_to have_css '.alert-lock' + expect(rendered).to have_no_css '.alert-lock' end it 'does not render a lock held by the current session' do @@ -46,7 +46,7 @@ render - expect(rendered).not_to have_css '.alert-lock' + expect(rendered).to have_no_css '.alert-lock' end it 'attaches a data-lock attribute to the cancel button' do @@ -62,7 +62,7 @@ render expect(rendered).to have_link 'Cancel' - expect(rendered).not_to have_css 'a[data-lock]', text: 'Cancel' + expect(rendered).to have_no_css 'a[data-lock]', text: 'Cancel' end end end diff --git a/spec/views/spotlight/pages/index.html.erb_spec.rb b/spec/views/spotlight/pages/index.html.erb_spec.rb index 6e8af0c1c..fd18fa07d 100644 --- a/spec/views/spotlight/pages/index.html.erb_spec.rb +++ b/spec/views/spotlight/pages/index.html.erb_spec.rb @@ -35,7 +35,7 @@ it 'does not disable the update button' do assign(:pages, []) render - expect(rendered).not_to have_selector 'button[disabled]', text: 'Save changes' + expect(rendered).to have_no_selector 'button[disabled]', text: 'Save changes' expect(rendered).to have_selector 'button', text: 'Save changes' end end diff --git a/spec/views/spotlight/pages/show.html.erb_spec.rb b/spec/views/spotlight/pages/show.html.erb_spec.rb index 8f333e5bc..e1066c3c1 100644 --- a/spec/views/spotlight/pages/show.html.erb_spec.rb +++ b/spec/views/spotlight/pages/show.html.erb_spec.rb @@ -25,7 +25,7 @@ it 'does not render an empty heading' do allow(page).to receive_messages(title: nil) render - expect(rendered).not_to have_css('.page-title') + expect(rendered).to have_no_css('.page-title') end it 'injects the page title into the html title' do diff --git a/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb b/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb index dcc9c6a10..7e7d6e894 100644 --- a/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +++ b/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb @@ -37,7 +37,7 @@ end it 'hides the config for the empty genre facet' do - expect(rendered).not_to have_content 'Genre' + expect(rendered).to have_no_content 'Genre' end describe do @@ -48,7 +48,7 @@ end it 'hides the config facets configured not to display' do - expect(rendered).not_to have_content 'Some hidden field' + expect(rendered).to have_no_content 'Some hidden field' end end end diff --git a/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb b/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb index 3eabdd07d..46be135b0 100644 --- a/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +++ b/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb @@ -40,12 +40,12 @@ end it 'excludes search options that do not show up in the search dropdown' do - expect(rendered).not_to have_selector "input[name='blacklight_configuration[search_fields][autocomplete][enabled]']" - expect(rendered).not_to have_selector "input[name='blacklight_configuration[search_fields][some_hidden_field][enabled]']" + expect(rendered).to have_no_selector "input[name='blacklight_configuration[search_fields][autocomplete][enabled]']" + expect(rendered).to have_no_selector "input[name='blacklight_configuration[search_fields][some_hidden_field][enabled]']" end it 'excludes search options that have if/unless configuration that causes them not to be displayed' do - expect(rendered).not_to have_selector "input[name='blacklight_configuration[search_fields][some_field_with_a_condition][enabled]']" + expect(rendered).to have_no_selector "input[name='blacklight_configuration[search_fields][some_field_with_a_condition][enabled]']" end it 'parameterizes the data-id attribute for search field key' do diff --git a/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb b/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb index 9b0025366..c261573e9 100644 --- a/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +++ b/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb @@ -35,6 +35,6 @@ it 'hides fields that are configured not to display' do render partial: 'spotlight/search_configurations/sort', locals: { f: f } - expect(rendered).not_to have_css('[data-id="some_disabled_field"]') + expect(rendered).to have_no_css('[data-id="some_disabled_field"]') end end diff --git a/spec/views/spotlight/shared/_exhibit_sidebar.html.erb_spec.rb b/spec/views/spotlight/shared/_exhibit_sidebar.html.erb_spec.rb index 663b94bde..e8fa36c3b 100644 --- a/spec/views/spotlight/shared/_exhibit_sidebar.html.erb_spec.rb +++ b/spec/views/spotlight/shared/_exhibit_sidebar.html.erb_spec.rb @@ -23,7 +23,7 @@ it 'does not have an analytics link in the sidebar' do render - expect(rendered).not_to have_link 'Analytics' + expect(rendered).to have_no_link 'Analytics' end end end diff --git a/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb b/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb index 09ca093e2..1da33542b 100644 --- a/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +++ b/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb @@ -32,7 +32,7 @@ expect(rendered).to have_selector '.box', text: 'OSD' expect(rendered).to have_selector '.items-col' expect(rendered).to have_selector '.text-col' - expect(rendered).not_to have_selector '.col-md-12' + expect(rendered).to have_no_selector '.col-md-12' end context 'with a block with no text' do diff --git a/spec/views/spotlight/translations/_page.html.erb_spec.rb b/spec/views/spotlight/translations/_page.html.erb_spec.rb index 8d4cc11f9..d62621a64 100644 --- a/spec/views/spotlight/translations/_page.html.erb_spec.rb +++ b/spec/views/spotlight/translations/_page.html.erb_spec.rb @@ -56,7 +56,7 @@ it 'does not render a delete link' do render - expect(rendered).not_to have_link('Delete') + expect(rendered).to have_no_link('Delete') end end end @@ -70,7 +70,7 @@ it 'does not include the data attribute used by the progress tracker' do render - expect(rendered).not_to have_css('[data-translation-present="true"]') + expect(rendered).to have_no_css('[data-translation-present="true"]') end end end From 73da786b5b1ad22ee296031958f279f13620d24a Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 5 Jan 2024 14:56:40 -0600 Subject: [PATCH 3/5] Install missing webpack dependencies --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0bfdd129a..28b512389 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,8 @@ WORKDIR /spotlight/app RUN SKIP_TRANSLATION=yes rails _${RAILS_VERSION}_ new . -j webpack --force --template=../engine/template.rb RUN bundle add pg +RUN bin/yarn add @babel/plugin-proposal-private-methods --dev +RUN bin/yarn add @babel/plugin-proposal-private-property-in-object RUN SKIP_TRANSLATION=yes DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile ENTRYPOINT ["/sbin/tini", "--", "/spotlight/engine/bin/docker-entrypoint.sh"] From 92a8f826563c0da27eb6aaa3fde141980d1c50f6 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 5 Jan 2024 14:58:22 -0600 Subject: [PATCH 4/5] Use bundler 2.5.2 Until https://github.com/rubygems/rubygems/issues/7357 is resolved --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a46e855e0..ff835028f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -47,7 +47,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - bundler: latest + bundler: '2.5.2' ruby-version: ${{ matrix.ruby }} - name: Run tests run: bundle exec rake From 77b0da644af42b09fd8c76201c5986121708fede Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 5 Jan 2024 15:00:41 -0600 Subject: [PATCH 5/5] Pin bundler at 2.4.22 as long as we have Ruby 2.7 --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ff835028f..3130b0838 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -47,7 +47,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - bundler: '2.5.2' + bundler: '2.4.22' ruby-version: ${{ matrix.ruby }} - name: Run tests run: bundle exec rake