From b3654e0b92312797e2ad0be1f8aedb6f25207225 Mon Sep 17 00:00:00 2001 From: Cory Lown Date: Tue, 12 Mar 2024 15:11:24 -0400 Subject: [PATCH] Run rubocop autocorrect --- .../components/arclight/breadcrumb_component_spec.rb | 8 ++++---- .../arclight/document_download_component_spec.rb | 2 +- .../components/arclight/search_bar_component_spec.rb | 6 +++--- spec/features/collection_context_spec.rb | 2 +- spec/features/collection_filtering_spec.rb | 4 ++-- spec/features/collection_page_spec.rb | 10 +++++----- spec/features/compact_search_results_spec.rb | 2 +- spec/features/component_page_spec.rb | 6 +++--- spec/features/document_tools_spec.rb | 2 +- spec/features/google_form_request_spec.rb | 4 ++-- spec/features/grouped_results_spec.rb | 4 ++-- spec/features/highlighted_search_results_spec.rb | 2 +- spec/features/masthead_links_spec.rb | 2 +- spec/features/repositories_page_spec.rb | 2 +- spec/features/search_results_spec.rb | 12 ++++++------ spec/views/repositories/index.html.erb_spec.rb | 4 ++-- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/spec/components/arclight/breadcrumb_component_spec.rb b/spec/components/arclight/breadcrumb_component_spec.rb index 040cbe0c3..73a47c317 100644 --- a/spec/components/arclight/breadcrumb_component_spec.rb +++ b/spec/components/arclight/breadcrumb_component_spec.rb @@ -30,8 +30,8 @@ it 'renders only that many breadcrumb links' do expect(rendered).to have_selector 'li', text: 'my repository' expect(rendered).to have_link 'ABC123', href: '/catalog/abc123' - expect(rendered).not_to have_link 'DEF', href: '/catalog/abc123_def' - expect(rendered).not_to have_link 'GHI', href: '/catalog/abc123_ghi' + expect(rendered).to have_no_link 'DEF', href: '/catalog/abc123_def' + expect(rendered).to have_no_link 'GHI', href: '/catalog/abc123_ghi' end it 'renders an ellipsis if there are more links than the count' do @@ -43,8 +43,8 @@ let(:attr) { { offset: 2 } } it 'skips some breadcrumb links' do - expect(rendered).not_to have_selector 'li', text: 'my repository' - expect(rendered).not_to have_link 'ABC123', href: '/catalog/abc123' + expect(rendered).to have_no_selector 'li', text: 'my repository' + expect(rendered).to have_no_link 'ABC123', href: '/catalog/abc123' expect(rendered).to have_link 'DEF', href: '/catalog/abc123_def' expect(rendered).to have_link 'GHI', href: '/catalog/abc123_ghi' end diff --git a/spec/components/arclight/document_download_component_spec.rb b/spec/components/arclight/document_download_component_spec.rb index 9ac1e6b60..a5c2ba73b 100644 --- a/spec/components/arclight/document_download_component_spec.rb +++ b/spec/components/arclight/document_download_component_spec.rb @@ -18,7 +18,7 @@ let(:files) { [] } it 'renders nothing' do - expect(page).not_to have_css('*') + expect(page).to have_no_css('*') end end diff --git a/spec/components/arclight/search_bar_component_spec.rb b/spec/components/arclight/search_bar_component_spec.rb index 38c013b8e..48dd3124f 100644 --- a/spec/components/arclight/search_bar_component_spec.rb +++ b/spec/components/arclight/search_bar_component_spec.rb @@ -20,7 +20,7 @@ let(:params) { { f: { collection: ['some collection'] } } } it 'renders a name attribute on the select (so it will be sent through the form)' do - expect(rendered).to have_css('select[name="f[collection][]"]') + expect(rendered).to have_select('f[collection][]') end it 'has the "this collection" option selected' do @@ -36,7 +36,7 @@ end it 'renders a name attribute on the select (so it will be sent through the form)' do - expect(rendered).to have_css('select[name="f[collection][]"]') + expect(rendered).to have_select('f[collection][]') end it 'has the "this collection" option selected' do @@ -46,7 +46,7 @@ context 'when not in a collection context' do it 'does not render a name attribute on the select (because it does not need to be sent through the form)' do - expect(rendered).not_to have_select 'name' + expect(rendered).to have_no_select 'name' end it 'has the "this collection" option disabled' do diff --git a/spec/features/collection_context_spec.rb b/spec/features/collection_context_spec.rb index acd307c4b..3e243706e 100644 --- a/spec/features/collection_context_spec.rb +++ b/spec/features/collection_context_spec.rb @@ -25,7 +25,7 @@ end it 'siblings above are hidden' do - expect(page).not_to have_css '#aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' + expect(page).to have_no_css '#aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' end end end diff --git a/spec/features/collection_filtering_spec.rb b/spec/features/collection_filtering_spec.rb index 310327681..1a5af3c6b 100644 --- a/spec/features/collection_filtering_spec.rb +++ b/spec/features/collection_filtering_spec.rb @@ -22,7 +22,7 @@ click_button 'Search' expect(page).to have_css('.al-document-listings .document', count: 10) # has results - expect(page).not_to have_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992') + expect(page).to have_no_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992') end end @@ -62,7 +62,7 @@ fill_in 'q', with: 'File' click_button 'Search' - expect(page).not_to have_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992') + expect(page).to have_no_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992') expect(page).to have_css('.al-document-listings .document', count: 10) # has results end end diff --git a/spec/features/collection_page_spec.rb b/spec/features/collection_page_spec.rb index 6fd80f576..d9898445a 100644 --- a/spec/features/collection_page_spec.rb +++ b/spec/features/collection_page_spec.rb @@ -43,7 +43,7 @@ let(:doc_id) { 'm0198-xml' } it 'is not rendered' do - expect(page).not_to have_css('.card', text: 'Online content') + expect(page).to have_no_css('.card', text: 'Online content') end end end @@ -149,7 +149,7 @@ expect(page).to have_css('dd', text: 'Bierring, Walter L. (Walter Lawrence), 1868-1961') expect(page).to have_css('dd', text: 'Mindanao Island (Philippines)') expect(page).to have_css('td', text: 'ABC Something') - expect(page).not_to have_css('dd', text: 'Higgins, L. Raymond') + expect(page).to have_no_css('dd', text: 'Higgins, L. Raymond') end end @@ -168,7 +168,7 @@ let(:doc_id) { 'm0198-xml' } it 'are not displayed' do - expect(page).not_to have_css('.al-show-sub-heading', text: 'Related') + expect(page).to have_no_css('.al-show-sub-heading', text: 'Related') end end end @@ -188,7 +188,7 @@ it 'does not include links to those sections' do within '.al-sidebar-navigation-context' do - expect(page).not_to have_link 'Related' + expect(page).to have_no_link 'Related' end end end @@ -241,7 +241,7 @@ visit search_catalog_path q: '', search_field: 'all_fields' expect(page).to have_css('.al-document-listings.documents-list') - expect(page).not_to have_css('.al-document-listings.documents-hierarchy') + expect(page).to have_no_css('.al-document-listings.documents-hierarchy') end end end diff --git a/spec/features/compact_search_results_spec.rb b/spec/features/compact_search_results_spec.rb index cbb17a208..29f3dee80 100644 --- a/spec/features/compact_search_results_spec.rb +++ b/spec/features/compact_search_results_spec.rb @@ -12,7 +12,7 @@ click_link 'Compact' - expect(page).not_to have_css('.documents-list') + expect(page).to have_no_css('.documents-list') expect(page).to have_css('.documents-compact') expect(page).to have_css('article.document', count: 10) within '.document-position-3' do diff --git a/spec/features/component_page_spec.rb b/spec/features/component_page_spec.rb index 46dd8d4b0..6e6b02387 100644 --- a/spec/features/component_page_spec.rb +++ b/spec/features/component_page_spec.rb @@ -27,7 +27,7 @@ describe 'label/title' do it 'does not double escape entities in the heading' do expect(page).to have_css('h1', text: /"A brief account of the origin of/) - expect(page).not_to have_css('h1', text: /^"A brief account of the origin of/) + expect(page).to have_no_css('h1', text: /^"A brief account of the origin of/) end end @@ -203,7 +203,7 @@ expect(page).to have_css '.document-title-heading', text: 'Item AA001' expect(page).to have_css '.document-title-heading', text: 'Item AA002' expect(page).to have_css '.document-title-heading', text: 'Item AA003' - expect(page).not_to have_css '.document-title-heading', text: 'Item AA004' + expect(page).to have_no_css '.document-title-heading', text: 'Item AA004' expect(page).to have_css '.document-title-heading', text: 'Item AA059' end end @@ -211,7 +211,7 @@ it 'offers a button for displaying the hidden sibling document items' do within '#collection-context' do expect(page).to have_css '.btn-secondary', text: 'Expand' - expect(page).not_to have_css '.document-title-heading', text: 'Item AA004' + expect(page).to have_no_css '.document-title-heading', text: 'Item AA004' first('.btn-secondary', text: 'Expand').click diff --git a/spec/features/document_tools_spec.rb b/spec/features/document_tools_spec.rb index 52e1ebb99..90843d312 100644 --- a/spec/features/document_tools_spec.rb +++ b/spec/features/document_tools_spec.rb @@ -18,7 +18,7 @@ let(:doc_id) { 'aoa271' } it 'does not render the bookmark option' do - expect(page).not_to have_css('.al-document-title-bar form.bookmark-toggle') + expect(page).to have_no_css('.al-document-title-bar form.bookmark-toggle') end end diff --git a/spec/features/google_form_request_spec.rb b/spec/features/google_form_request_spec.rb index 7d72f9e77..af53a09d3 100644 --- a/spec/features/google_form_request_spec.rb +++ b/spec/features/google_form_request_spec.rb @@ -26,7 +26,7 @@ context 'repository is not requestable' do it 'form is absent' do visit solr_document_path 'm0198-xml_aspace_ref14_di4' - expect(page).not_to have_css 'form' + expect(page).to have_no_css 'form' end end end @@ -35,7 +35,7 @@ context 'when container is absent' do it 'form is absent' do visit solr_document_path 'aoa271_aspace_238a0567431f36f49acea49ef576d408' - expect(page).not_to have_css 'form' + expect(page).to have_no_css 'form' end end diff --git a/spec/features/grouped_results_spec.rb b/spec/features/grouped_results_spec.rb index d0a07a311..401d4f3b7 100644 --- a/spec/features/grouped_results_spec.rb +++ b/spec/features/grouped_results_spec.rb @@ -51,8 +51,8 @@ within '.al-grouped-title-bar' do expect(page).to have_css 'h3 a', text: /Alpha/ - expect(page).not_to have_css '.al-document-abstract-or-scope', text: /founded in 1902/ - expect(page).not_to have_css('.badge') + expect(page).to have_no_css '.al-document-abstract-or-scope', text: /founded in 1902/ + expect(page).to have_no_css('.badge') end end end diff --git a/spec/features/highlighted_search_results_spec.rb b/spec/features/highlighted_search_results_spec.rb index e842a7537..d323fda71 100644 --- a/spec/features/highlighted_search_results_spec.rb +++ b/spec/features/highlighted_search_results_spec.rb @@ -19,7 +19,7 @@ it 'does not highlight the snippets on empty query' do visit search_catalog_path q: '', search_field: 'all_fields' within '.document-position-1' do - expect(page).not_to have_css '.al-document-highlight' + expect(page).to have_no_css '.al-document-highlight' end end end diff --git a/spec/features/masthead_links_spec.rb b/spec/features/masthead_links_spec.rb index 48161b53e..cef234c4a 100644 --- a/spec/features/masthead_links_spec.rb +++ b/spec/features/masthead_links_spec.rb @@ -7,7 +7,7 @@ it 'is not active when collection search is not activated' do visit search_catalog_path q: 'a brief', search_field: 'all_fields' within '.al-masthead' do - expect(page).not_to have_css 'li.nav-item.active', text: 'Collections' + expect(page).to have_no_css 'li.nav-item.active', text: 'Collections' end end diff --git a/spec/features/repositories_page_spec.rb b/spec/features/repositories_page_spec.rb index 482f6d587..10b7e7f00 100644 --- a/spec/features/repositories_page_spec.rb +++ b/spec/features/repositories_page_spec.rb @@ -38,7 +38,7 @@ click_link 'Stanford University Libraries. Special Collections and University Archives' within '.al-repository' do - expect(page).not_to have_css( + expect(page).to have_no_css( 'h2 a', text: 'Stanford University Libraries. Special Collections and University Archives' ) diff --git a/spec/features/search_results_spec.rb b/spec/features/search_results_spec.rb index d1ff1bfec..a79634615 100644 --- a/spec/features/search_results_spec.rb +++ b/spec/features/search_results_spec.rb @@ -51,14 +51,14 @@ end within not_online_doc do - expect(page).not_to have_css('.al-online-content-icon') + expect(page).to have_no_css('.al-online-content-icon') end end it 'does not include result numbers in the document header' do visit search_catalog_path q: '', search_field: 'all_fields' - expect(page).not_to have_css('.document-counter') + expect(page).to have_no_css('.document-counter') end it 'does not double escape entities in the heading' do @@ -67,7 +67,7 @@ 'h3.index_title', text: '"A brief account of the origin of the Alpha Omega Alpha Honorary Fraternity" - William W. Root, n.d.' ) - expect(page).not_to have_css( + expect(page).to have_no_css( 'h3.index_title', text: /"e;A brief account of the origin/ ) @@ -135,13 +135,13 @@ expect(page).to have_css('.al-repository-card') expect(page).to have_css('.al-repository') - expect(page).not_to have_css('.al-repository-extra') + expect(page).to have_no_css('.al-repository-extra') end it 'does not include repository card if not faceted on repository' do visit search_catalog_path q: '', search_field: 'all_fields' - expect(page).not_to have_css('.al-repository-card') + expect(page).to have_no_css('.al-repository-card') end it 'does not include repository card if faceted on something that is not repository' do @@ -149,7 +149,7 @@ names: ['Owner of the reel of yellow nylon rope'] }, search_field: 'all_fields' - expect(page).not_to have_css('.al-repository-card') + expect(page).to have_no_css('.al-repository-card') end end diff --git a/spec/views/repositories/index.html.erb_spec.rb b/spec/views/repositories/index.html.erb_spec.rb index a6f6050a6..f201695b0 100644 --- a/spec/views/repositories/index.html.erb_spec.rb +++ b/spec/views/repositories/index.html.erb_spec.rb @@ -86,13 +86,13 @@ assign(:repository, Arclight::Repository.new(name: 'My Repository')) allow(view).to receive(:on_repositories_index?).and_return(false) render - expect(rendered).not_to have_css('.al-repository-extra') + expect(rendered).to have_no_css('.al-repository-extra') end it 'does not show on search page' do allow(view).to receive(:on_repositories_index?).and_return(false) render - expect(rendered).not_to have_css('.al-repository-extra') + expect(rendered).to have_no_css('.al-repository-extra') end end end