Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run rubocop autocorrect #1515

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec/components/arclight/breadcrumb_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
let(:files) { [] }

it 'renders nothing' do
expect(page).not_to have_css('*')
expect(page).to have_no_css('*')
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/components/arclight/search_bar_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/features/collection_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions spec/features/collection_filtering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions spec/features/collection_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/features/compact_search_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/features/component_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -203,15 +203,15 @@
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

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

Expand Down
2 changes: 1 addition & 1 deletion spec/features/document_tools_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/features/google_form_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/features/grouped_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/features/highlighted_search_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/features/masthead_links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/features/repositories_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down
12 changes: 6 additions & 6 deletions spec/features/search_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: /&quote;A brief account of the origin/
)
Expand Down Expand Up @@ -135,21 +135,21 @@

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
visit search_catalog_path f: {
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

Expand Down
4 changes: 2 additions & 2 deletions spec/views/repositories/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading