Skip to content
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
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ Metrics/MethodLength:
Metrics/PerceivedComplexity:
Max: 9

# Offense count: 60
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle.
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RSpec.describe CatalogController do
describe 'index action customizations' do
context 'any other view' do
context 'with any other view' do
it 'starts a search_session' do
allow(controller).to receive(:search_results)
session[:history] = []
Expand Down
2 changes: 1 addition & 1 deletion spec/features/autocomplete_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper'

RSpec.describe 'Autocomplete', :js do
context 'site-wide search form' do
describe 'site-wide search form' do
it 'is configured properly to allow non-prefix autocomplete' do
visit '/catalog'
find_by_id('q').send_keys 'by-laws'
Expand Down
6 changes: 3 additions & 3 deletions spec/features/collection_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
end
end

context 'sections that do not have metadata' do
context 'with sections that do not have metadata' do
let(:doc_id) { 'm0198-xml' }

it 'are not displayed' do
Expand All @@ -183,7 +183,7 @@
end
end

context 'for sections that do not have metadata' do
context 'with sections that do not have metadata' do
let(:doc_id) { 'm0198-xml' }

it 'does not include links to those sections' do
Expand Down Expand Up @@ -264,7 +264,7 @@
end
end

context 'content with file downloads', :js do
context 'with content that has file downloads', :js do
let(:doc_id) { 'a0011-xml_aspace_ref6_lx4' }

it 'renders links to the files for download' 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 @@ -159,7 +159,7 @@ def wait_for_hierarchy_to_load
end
end

context 'siblings and highlighted self' do
describe 'siblings and highlighted self' do
it 'has all siblings' do
within '#collection-context' do
expect(page).to have_css(
Expand Down Expand Up @@ -199,7 +199,7 @@ def wait_for_hierarchy_to_load
end
end

context 'duplicate titles' do
context 'with duplicate titles' do
let(:doc_id) { 'lc0100_aspace_c5ef89d4ae68bb77e7c641f3edb3f1c8' }

it 'does not highlight duplicate titles' do
Expand Down Expand Up @@ -317,7 +317,7 @@ def wait_for_hierarchy_to_load
end
end

context 'content with file downloads', :js do
context 'with content that has file downloads', :js do
let(:doc_id) { 'a0011-xml_aspace_ref6_lx4' }

it 'renders links to the files for download' do
Expand Down
8 changes: 4 additions & 4 deletions spec/features/google_form_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

xdescribe 'Google Form Request', :js do
context 'when container is present' do
context 'repository is requestable' do
context 'when the repository is requestable' do
it 'form is present with filled out values' do
visit solr_document_path 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04'

Expand All @@ -23,7 +23,7 @@
end
end

context 'repository is not requestable' do
context 'when the repository is not requestable' do
it 'form is absent' do
visit solr_document_path 'm0198-xml_aspace_ref14_di4'
expect(page).to have_css 'h1'
Expand All @@ -41,14 +41,14 @@
end
end

context 'in search results' do
context 'when in search results' do
it 'shows up when item is requestable' do
visit search_catalog_path q: 'alpha', search_field: 'all_fields'
expect(page).to have_css 'form[action*="https://docs.google.com"]', count: 4
end
end

context 'in collection hierarchy' do
context 'when in the collection hierarchy' do
it 'shows up in hierarchy' do
visit solr_document_path 'aoa271'
click_on 'Contents'
Expand Down
4 changes: 2 additions & 2 deletions spec/features/online_content_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
before { visit solr_document_path(id: doc_id) }

describe 'Viewer' do
context 'embedded content' do
context 'with embedded content' do
let(:doc_id) { 'a0011-xml_aspace_ref6_lx4' }

it 'renders digital object viewer initialization markup', :js do
Expand All @@ -19,7 +19,7 @@
end
end

context 'non-embeddable content' do
context 'with non-embeddable content' do
let(:doc_id) { 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' }

it 'renders a list of links', :js do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/search_breadcrumb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper'

RSpec.describe 'Search Breadcrumb' do
context 'on regular search results' do
context 'when on regular search results' do
it do
visit search_catalog_path q: 'a brief', search_field: 'all_fields'
within '.al-search-breadcrumb' do
Expand Down
14 changes: 7 additions & 7 deletions spec/features/search_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,49 @@
end

describe 'default all fields search for' do
context 'EAD ID' do
context 'with an EAD ID' do
it 'returns a collection with a matching EAD ID' do
visit search_catalog_path q: 'umich-bhl-851981', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Interlochen Center for The Arts records/
end
end

context 'component ref ID' do
context 'with a component ref ID' do
it 'returns a component with a matching ref' do
visit search_catalog_path q: 'aspace_563a320bb37d24a9e1e6f7bf95b52671', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Series I: Administrative Records/
end
end

context 'component full ID (with eadid & ref)' do
context 'with a component full ID (with eadid & ref)' do
it 'returns a component with a matching full ID' do
visit search_catalog_path q: 'aoa271_aspace_2d7e583e94eb2b46d5dd1a0ec4cdca1f', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Dr. Root and L. Raymond Higgins/
end
end

context 'container' do
context 'with a container' do
it 'returns a component with a matching container' do
visit search_catalog_path q: '"box 92"', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Card index/
end
end

context 'language' do
context 'with a language' do
it 'returns a component with a matching language' do
visit search_catalog_path q: 'english', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Stanford University student life photograph album/
end
end

context 'terms appearing in different ancestor component titles' do
context 'when terms appear in different ancestor component titles' do
it 'returns a component where one term hit is only in its parent title' do
visit search_catalog_path q: 'administrative hippocrates', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /The constitution of the Alpha Omega/
end
end

context 'search containing stand-alone punctuation' do
context 'when the search contains stand-alone punctuation' do
it 'returns results' do
visit search_catalog_path q: 'constitution amendments - drafts', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Constitution amendments - drafts/
Expand Down
2 changes: 1 addition & 1 deletion spec/features/search_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
end
end

context 'by relevance without a query' do
context 'when sorting by relevance without a query' do
let(:collection) { 'Alpha Omega Alpha Archives, 1894-1992' }

it 'lists a collection and its components in the order they appear in the finding aid' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/traject/ead2_indexing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def components(result)
expect(all_components.length).to eq 38
end

context 'nested component' do
context 'with a nested component' do
describe 'accessrestrict' do
context 'with its own accessrestrct' do
let(:component_with_own_accessrestrict) do
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/arclight_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
it { is_expected.to eq 'Collections' }
end

context 'all other non-special search behavior' do
context 'with any other search behavior' do
it { is_expected.to eq 'Search' }
end
end
Expand All @@ -144,7 +144,7 @@
expect(helper.document_level_icon(document)).to eq 'collection'
end

context 'there is no level_ssm' do
context 'when there is no level_ssm' do
let(:document) { SolrDocument.new }

it 'gives the default icon' do
Expand Down
18 changes: 9 additions & 9 deletions spec/lib/arclight/normalized_date_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
let(:date_bulk) { '1999-2005' }
let(:date_other) { 'Undated' }

context 'under normal conditions' do
context 'with inclusive, bulk, and other dates' do
it 'joins dates' do
expect(normalized_date).to eq '1990-2000, Undated, bulk 1999-2005'
end

context 'multiple normalized dates' do
context 'with multiple normalized dates' do
let(:date_inclusive) { %w[1990 1992] }

it 'are joined w/ a comma' do
Expand All @@ -26,7 +26,7 @@
context 'with special case dates' do
# NOTE: This test is the only place where the code that exercises this is routable
# This has to be a multidimensional array, and the resulting XML nodes sent in are always flat
context 'multiples' do
context 'with multiple date ranges' do
let(:date_inclusive) { [%w[1990-2000 2001-2002 2004]] }
let(:date_bulk) { '1990-2004' }

Expand All @@ -35,23 +35,23 @@
end
end

context 'undated' do
context 'with an undated bulk date' do
let(:date_bulk) { 'n.d.' }

it 'do not normalized term "undated"' do
expect(normalized_date).to eq '1990-2000, Undated, bulk n.d.'
end
end

context 'circa' do
context 'with a circa bulk date' do
let(:date_bulk) { 'c.1995' }

it 'do not normalized term "circa"' do
expect(normalized_date).to eq '1990-2000, Undated, bulk c.1995'
end
end

context 'no bulk' do
context 'without bulk or other dates' do
let(:date_bulk) { nil }
let(:date_other) { nil }

Expand All @@ -60,7 +60,7 @@
end
end

context 'no inclusive or bulk but other' do
context 'with only an other date' do
let(:date_inclusive) { nil }
let(:date_bulk) { nil }
let(:date_other) { 'n.d.' }
Expand All @@ -70,15 +70,15 @@
end
end

context 'no inclusive but bulk' do
context 'without an inclusive date' do
let(:date_inclusive) { nil }

it 'uses other and bulk' do
expect(normalized_date).to eq 'Undated, bulk 1999-2005'
end
end

context 'no information' do
context 'without any dates' do
let(:date_inclusive) { nil }
let(:date_bulk) { nil }
let(:date_other) { nil }
Expand Down
Loading
Loading