diff --git a/app/models/arclight/parent.rb b/app/models/arclight/parent.rb index cf8856cdb..3d4489fe7 100644 --- a/app/models/arclight/parent.rb +++ b/app/models/arclight/parent.rb @@ -25,7 +25,7 @@ def collection? def global_id return id if eadid == id - "#{eadid}#{id}" + "#{eadid}_#{id}" end end end diff --git a/lib/arclight/traject/ead2_component_config.rb b/lib/arclight/traject/ead2_component_config.rb index dcca0f82d..03498af05 100644 --- a/lib/arclight/traject/ead2_component_config.rb +++ b/lib/arclight/traject/ead2_component_config.rb @@ -29,7 +29,7 @@ provide 'title_normalizer', 'Arclight::NormalizedTitle' provide 'reader_class_name', 'Arclight::Traject::NokogiriNamespacelessReader' provide 'logger', Logger.new($stderr) - provide 'component_identifier_format', '%s%s' + provide 'component_identifier_format', '%s_%s' end NAME_ELEMENTS = %w[corpname famname name persname].freeze diff --git a/lib/arclight/traject/ead2_config.rb b/lib/arclight/traject/ead2_config.rb index 7cce3421f..b2371f9bf 100644 --- a/lib/arclight/traject/ead2_config.rb +++ b/lib/arclight/traject/ead2_config.rb @@ -58,7 +58,6 @@ provide 'solr_writer.commit_on_close', 'true' provide 'repository', ENV.fetch('REPOSITORY_ID', nil) provide 'logger', Logger.new($stderr) - provide 'component_traject_config', File.join(__dir__, 'ead2_component_config.rb') end each_record do |_record, context| diff --git a/spec/components/arclight/breadcrumb_component_spec.rb b/spec/components/arclight/breadcrumb_component_spec.rb index 1a664dde5..1e9909285 100644 --- a/spec/components/arclight/breadcrumb_component_spec.rb +++ b/spec/components/arclight/breadcrumb_component_spec.rb @@ -29,8 +29,8 @@ it 'renders only that many breadcrumb links' do expect(rendered).to have_selector 'li', text: 'my repository' - expect(rendered).to have_link 'DEF', href: '/catalog/abc123def' - expect(rendered).not_to have_link 'GHI', href: '/catalog/abc123ghi' + expect(rendered).to have_link 'DEF', href: '/catalog/abc123_def' + expect(rendered).not_to have_link 'GHI', href: '/catalog/abc123_ghi' end it 'renders an ellipsis if there are more links than the count' do @@ -43,14 +43,14 @@ it 'skips some breadcrumb links' do expect(rendered).not_to have_selector 'li', text: 'my repository' - expect(rendered).not_to have_link 'DEF', href: '/catalog/abc123def' - expect(rendered).to have_link 'GHI', href: '/catalog/abc123ghi' + expect(rendered).not_to have_link 'DEF', href: '/catalog/abc123_def' + expect(rendered).to have_link 'GHI', href: '/catalog/abc123_ghi' end end it 'renders breadcrumb links' do expect(rendered).to have_selector 'li', text: 'my repository' - expect(rendered).to have_link 'DEF', href: '/catalog/abc123def' - expect(rendered).to have_link 'GHI', href: '/catalog/abc123ghi' + expect(rendered).to have_link 'DEF', href: '/catalog/abc123_def' + expect(rendered).to have_link 'GHI', href: '/catalog/abc123_ghi' end end diff --git a/spec/features/aeon_web_ead_request_spec.rb b/spec/features/aeon_web_ead_request_spec.rb index e5b254c99..92310d34d 100644 --- a/spec/features/aeon_web_ead_request_spec.rb +++ b/spec/features/aeon_web_ead_request_spec.rb @@ -7,7 +7,7 @@ it 'creates a request link' do visit solr_document_path 'm0198-xml' - within '#m0198-xmlaspace_ref11_d0s-hierarchy-item' do + within '#m0198-xml_aspace_ref11_d0s-hierarchy-item' do click_link 'Pages 1-78' end expect(page).to have_css( diff --git a/spec/features/arclight_spec.rb b/spec/features/arclight_spec.rb index ea78d787f..dbb882578 100644 --- a/spec/features/arclight_spec.rb +++ b/spec/features/arclight_spec.rb @@ -10,7 +10,7 @@ describe 'eadid with a period' do it 'is visitable with a hyphen' do - visit solr_document_path('m0198-xmlaspace_ref11_d0s') + visit solr_document_path('m0198-xml_aspace_ref11_d0s') expect(page).to have_css 'h1', text: 'Pages 1-78' end end diff --git a/spec/features/collection_context_spec.rb b/spec/features/collection_context_spec.rb index 9cd8785cf..acd307c4b 100644 --- a/spec/features/collection_context_spec.rb +++ b/spec/features/collection_context_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Collection context', js: true do - let(:doc_id) { 'aoa271aspace_6ea193f778e553ca9ea0d00a3e5a1891' } + let(:doc_id) { 'aoa271_aspace_6ea193f778e553ca9ea0d00a3e5a1891' } before do visit solr_document_path(id: doc_id) @@ -15,17 +15,17 @@ end it 'siblings are not expanded' do - expect(page).to have_css '.al-toggle-view-children.collapsed[href="#collapsible-hierarchy-aoa271aspace_b70574c7229e6f237f780579cc04595d"]' + expect(page).to have_css '.al-toggle-view-children.collapsed[href="#collapsible-hierarchy-aoa271_aspace_b70574c7229e6f237f780579cc04595d"]' end it 'direct ancestors are expanded' do - expect(page).to have_css '#collapsible-hierarchy-aoa271aspace_f934f1add34289f28bd0feb478e68275.show', visible: :visible - expect(page).to have_css '#collapsible-hierarchy-aoa271aspace_238a0567431f36f49acea49ef576d408.show', visible: :visible - expect(page).to have_css '#collapsible-hierarchy-aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671.show', visible: :visible + expect(page).to have_css '#collapsible-hierarchy-aoa271_aspace_f934f1add34289f28bd0feb478e68275.show', visible: :visible + expect(page).to have_css '#collapsible-hierarchy-aoa271_aspace_238a0567431f36f49acea49ef576d408.show', visible: :visible + expect(page).to have_css '#collapsible-hierarchy-aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671.show', visible: :visible end it 'siblings above are hidden' do - expect(page).not_to have_css '#aoa271aspace_843e8f9f22bac69872d0802d6fffbb04' + expect(page).not_to have_css '#aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' end end end diff --git a/spec/features/collection_filtering_spec.rb b/spec/features/collection_filtering_spec.rb index f6c6c5f12..1de5e4eff 100644 --- a/spec/features/collection_filtering_spec.rb +++ b/spec/features/collection_filtering_spec.rb @@ -38,7 +38,7 @@ context 'when on a record view' do it 'has the a select input with the "this collection" option selected' do - visit solr_document_path('lc0100aspace_327a75c226d44aa1a769edb4d2f13c6e') + visit solr_document_path('lc0100_aspace_327a75c226d44aa1a769edb4d2f13c6e') within 'form.search-query-form' do expect(page).to have_select('Search', selected: 'this collection') @@ -46,7 +46,7 @@ end it 'searches within the collection context by default' do - visit solr_document_path('aoa271aspace_dba76dab6f750f31aa5fc73e5402e71d') + visit solr_document_path('aoa271_aspace_dba76dab6f750f31aa5fc73e5402e71d') fill_in 'q', with: 'File' click_button 'Search' @@ -56,7 +56,7 @@ end it 'allows the user to choose to search all collections' do - visit solr_document_path('aoa271aspace_dba76dab6f750f31aa5fc73e5402e71d') + visit solr_document_path('aoa271_aspace_dba76dab6f750f31aa5fc73e5402e71d') select 'all collections', from: 'Search within' fill_in 'q', with: 'File' diff --git a/spec/features/collection_page_spec.rb b/spec/features/collection_page_spec.rb index 91c3ed16c..a760ab375 100644 --- a/spec/features/collection_page_spec.rb +++ b/spec/features/collection_page_spec.rb @@ -191,20 +191,20 @@ it 'sub components are viewable and expandable' do within '#collection-context' do - within '#aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671-hierarchy-item' do + within '#aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671-hierarchy-item' do click_link 'View' - within '#aoa271aspace_dc2aaf83625280ae2e193beb3f4aea78-hierarchy-item.al-collection-context' do + within '#aoa271_aspace_dc2aaf83625280ae2e193beb3f4aea78-hierarchy-item.al-collection-context' do expect(page).to have_link 'Constitution and by-laws' end click_link 'Expand' expect(page).to have_link 'Reports' - el = find_by_id('aoa271aspace_238a0567431f36f49acea49ef576d408-hierarchy-item') + el = find_by_id('aoa271_aspace_238a0567431f36f49acea49ef576d408-hierarchy-item') evaluate_script "window.scrollTo(0,#{el.rect.y - 100})" sleep 1 - within '#aoa271aspace_238a0567431f36f49acea49ef576d408-hierarchy-item' do + within '#aoa271_aspace_238a0567431f36f49acea49ef576d408-hierarchy-item' do click_link 'View' expect(page).to have_link 'Expansion Plan' - within '#aoa271aspace_f934f1add34289f28bd0feb478e68275-hierarchy-item' do + within '#aoa271_aspace_f934f1add34289f28bd0feb478e68275-hierarchy-item' do click_link 'View' expect(page).to have_link 'Initial Phase' expect(page).to have_link 'Phase II: Expansion' @@ -215,7 +215,7 @@ end it 'includes the number of direct children of the component' do - within '#aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671-hierarchy-item' do + within '#aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671-hierarchy-item' do expect(page).to have_css( '.al-number-of-children-badge', text: /25/ @@ -243,7 +243,7 @@ end context 'content with file downloads', js: true do - let(:doc_id) { 'a0011-xmlaspace_ref6_lx4' } + let(:doc_id) { 'a0011-xml_aspace_ref6_lx4' } it 'renders links to the files for download' do within '.al-show-actions-box-downloads-container' do @@ -260,7 +260,7 @@ end context 'with EAD documents which require Aeon requests' do - let(:doc_id) { 'm0198-xmlaspace_ref11_d0s' } + let(:doc_id) { 'm0198-xml_aspace_ref11_d0s' } it 'renders links to the Aeon request form' do expect(page).to have_css '.al-request' diff --git a/spec/features/component_page_spec.rb b/spec/features/component_page_spec.rb index 440a625c8..fddeb49f3 100644 --- a/spec/features/component_page_spec.rb +++ b/spec/features/component_page_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Component Page' do - let(:doc_id) { 'aoa271aspace_843e8f9f22bac69872d0802d6fffbb04' } + let(:doc_id) { 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' } let(:download_config) do ActiveSupport::HashWithIndifferentAccess.new( default: { @@ -52,7 +52,7 @@ end describe 'Indexed Terms subjects section' do - let(:doc_id) { 'aoa271aspace_01daa89087641f7fc9dbd7a10d3f2da9' } + let(:doc_id) { 'aoa271_aspace_01daa89087641f7fc9dbd7a10d3f2da9' } it 'includes subjects dt subheading text' do expect(page).to have_css('dt.blacklight-access_subjects', text: 'Subjects:') @@ -70,7 +70,7 @@ end describe 'metadata' do - let(:doc_id) { 'aoa271aspace_dc2aaf83625280ae2e193beb3f4aea78' } + let(:doc_id) { 'aoa271_aspace_dc2aaf83625280ae2e193beb3f4aea78' } it 'uses our rules for displaying containers' do expect(page).to have_css('dd', text: 'Box 1, Folder 4-5') @@ -143,7 +143,7 @@ end context 'duplicate titles' do - let(:doc_id) { 'lc0100aspace_c5ef89d4ae68bb77e7c641f3edb3f1c8' } + let(:doc_id) { 'lc0100_aspace_c5ef89d4ae68bb77e7c641f3edb3f1c8' } it 'does not highlight duplicate titles' do within '#collection-context .al-hierarchy-highlight' do @@ -153,7 +153,7 @@ end context 'when there are more than ten previous sibling documents for the current document' do - let(:doc_id) { 'lc0100aspace_ca60f0c03c4638b89e0348c3c6f7b50e' } + let(:doc_id) { 'lc0100_aspace_ca60f0c03c4638b89e0348c3c6f7b50e' } it 'hides all but the first sibling document items' do within '#collection-context' do @@ -178,18 +178,18 @@ end context 'when on a deeply nested component' do - let(:doc_id) { 'aoa271aspace_6ea193f778e553ca9ea0d00a3e5a1891' } + let(:doc_id) { 'aoa271_aspace_6ea193f778e553ca9ea0d00a3e5a1891' } it 'enables expanding nodes outside of own ancestor tree' do within '#collection-context' do - find('#aoa271aspace_01daa89087641f7fc9dbd7a10d3f2da9-hierarchy-item .al-toggle-view-children').click + find('#aoa271_aspace_01daa89087641f7fc9dbd7a10d3f2da9-hierarchy-item .al-toggle-view-children').click expect(page).to have_css '.document-title-heading', text: 'Miscellaneous 1999' end end it 'includes ancestor\'s preceding sibling when clicking ancestor\'s Expand button' do within '#collection-context' do - within('#collapsible-hierarchy-aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671') do + within('#collapsible-hierarchy-aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671') do first('.btn-secondary', text: 'Expand').click end expect(page).to have_css '.document-title-heading', text: 'Officers and directors - lists, 1961, n.d.' @@ -198,11 +198,11 @@ end context 'when on a component with an eadid with . normalized to -' do - let(:doc_id) { 'pc0170-xmlaspace_ref1_z0j' } + let(:doc_id) { 'pc0170-xml_aspace_ref1_z0j' } it 'expands child nodes when clicked' do within '#collection-context' do - find('#pc0170-xmlaspace_ref5_edi-hierarchy-item .al-toggle-view-children').click + find('#pc0170-xml_aspace_ref5_edi-hierarchy-item .al-toggle-view-children').click expect(page).to have_css '.document-title-heading', text: 'Restricted images, 1979-2000' end end @@ -237,7 +237,7 @@ end context 'content with file downloads', js: true do - let(:doc_id) { 'a0011-xmlaspace_ref6_lx4' } + let(:doc_id) { 'a0011-xml_aspace_ref6_lx4' } it 'renders links to the files for download' do within '.al-show-actions-box-downloads-container' do diff --git a/spec/features/document_tools_spec.rb b/spec/features/document_tools_spec.rb index ae80d5d3c..52e1ebb99 100644 --- a/spec/features/document_tools_spec.rb +++ b/spec/features/document_tools_spec.rb @@ -23,7 +23,7 @@ end context 'for components' do - let(:doc_id) { 'm0198-xmlaspace_ref11_d0s' } + let(:doc_id) { 'm0198-xml_aspace_ref11_d0s' } pending 'renders the bookmark option' do expect(page).to have_css('.al-document-title-bar form.bookmark-toggle') diff --git a/spec/features/google_form_request_spec.rb b/spec/features/google_form_request_spec.rb index ba03ffec0..7d72f9e77 100644 --- a/spec/features/google_form_request_spec.rb +++ b/spec/features/google_form_request_spec.rb @@ -6,11 +6,11 @@ context 'when container is present' do context 'repository is requestable' do it 'form is present with filled out values' do - visit solr_document_path 'aoa271aspace_843e8f9f22bac69872d0802d6fffbb04' + visit solr_document_path 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' within 'form' do expect(page).to have_css( - 'input[name="entry.1980510262"][value$="catalog/aoa271aspace_843e8f9f22bac69872d0802d6fffbb04"]', + 'input[name="entry.1980510262"][value$="catalog/aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04"]', visible: :hidden ) expect(page).to have_css('input[name="entry.619150170"][value="Alpha Omega Alpha Archives, 1894-1992"]', @@ -25,7 +25,7 @@ context 'repository is not requestable' do it 'form is absent' do - visit solr_document_path 'm0198-xmlaspace_ref14_di4' + visit solr_document_path 'm0198-xml_aspace_ref14_di4' expect(page).not_to have_css 'form' end end @@ -34,7 +34,7 @@ context 'when container is absent' do it 'form is absent' do - visit solr_document_path 'aoa271aspace_238a0567431f36f49acea49ef576d408' + visit solr_document_path 'aoa271_aspace_238a0567431f36f49acea49ef576d408' expect(page).not_to have_css 'form' end end @@ -57,7 +57,7 @@ end it 'shows up in context' do - visit solr_document_path 'aoa271aspace_843e8f9f22bac69872d0802d6fffbb04' + visit solr_document_path 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' within '#collection-context' do expect(page).to have_css 'form[action*="https://docs.google.com"]', count: 3 end diff --git a/spec/features/item_breadcrumbs_spec.rb b/spec/features/item_breadcrumbs_spec.rb index 79332cc10..16a35d89e 100644 --- a/spec/features/item_breadcrumbs_spec.rb +++ b/spec/features/item_breadcrumbs_spec.rb @@ -23,7 +23,7 @@ end it 'show page breadcrumbs' do - visit solr_document_path id: 'aoa271aspace_e8755922a9336970292ca817983e7139' + visit solr_document_path id: 'aoa271_aspace_e8755922a9336970292ca817983e7139' expect(page).to have_css 'li.breadcrumb-item a', count: 5 end end diff --git a/spec/features/many_component_ead_spec.rb b/spec/features/many_component_ead_spec.rb index 4aa23b57a..4df0d1ef5 100644 --- a/spec/features/many_component_ead_spec.rb +++ b/spec/features/many_component_ead_spec.rb @@ -16,7 +16,7 @@ within '#collection-context' do click_link 'View' click_link 'Expand' - within '#collapsible-hierarchy-lc0100aspace_327a75c226d44aa1a769edb4d2f13c6e' do + within '#collapsible-hierarchy-lc0100_aspace_327a75c226d44aa1a769edb4d2f13c6e' do expect(page).to have_css 'li.al-collection-context', count: 202 end end diff --git a/spec/features/online_content_spec.rb b/spec/features/online_content_spec.rb index 0b69b261e..7411913c2 100644 --- a/spec/features/online_content_spec.rb +++ b/spec/features/online_content_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' RSpec.describe 'Online Content' do - let(:doc_id) { 'aoa271aspace_843e8f9f22bac69872d0802d6fffbb04' } + let(:doc_id) { 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' } before { visit solr_document_path(id: doc_id) } describe 'Viewer' do context 'embedded content' do - let(:doc_id) { 'a0011-xmlaspace_ref6_lx4' } + let(:doc_id) { 'a0011-xml_aspace_ref6_lx4' } it 'renders digital object viewer initialization markup', js: true do expect(page).to have_css( @@ -20,7 +20,7 @@ end context 'non-embeddable content' do - let(:doc_id) { 'aoa271aspace_843e8f9f22bac69872d0802d6fffbb04' } + let(:doc_id) { 'aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04' } it 'renders a list of links', js: true do expect(page).to have_link 'Folder of digitized stuff' diff --git a/spec/features/traject/ead2_indexing_spec.rb b/spec/features/traject/ead2_indexing_spec.rb index aa51a9daf..212acfbf4 100644 --- a/spec/features/traject/ead2_indexing_spec.rb +++ b/spec/features/traject/ead2_indexing_spec.rb @@ -144,7 +144,7 @@ def components(result) end it 'id' do - expect(first_component).to include 'id' => ['a0011-xmlaspace_ref6_lx4'] + expect(first_component).to include 'id' => ['a0011-xml_aspace_ref6_lx4'] end it 'has_online_content' do @@ -211,7 +211,7 @@ def components(result) let(:fixture_path) do Arclight::Engine.root.join('spec', 'fixtures', 'ead', 'sample', 'large-components-list.xml') end - let(:nested_component) { all_components.find { |c| c['id'] == ['lc0100aspace_32ad9025a3a286358baeae91b5d7696e'] } } + let(:nested_component) { all_components.find { |c| c['id'] == ['lc0100_aspace_32ad9025a3a286358baeae91b5d7696e'] } } it 'builds the results' do expect(all_components.length).to eq 404 @@ -235,8 +235,8 @@ def components(result) let(:fixture_path) do Arclight::Engine.root.join('spec', 'fixtures', 'ead', 'nlm', 'ncaids544-id-test.xml') end - let(:component_with_descendants) { all_components.find { |c| c['id'] == ['ncaids544-testd0e452'] } } - let(:nested_component) { all_components.find { |c| c['id'] == ['ncaids544-testd0e631'] } } + let(:component_with_descendants) { all_components.find { |c| c['id'] == ['ncaids544-test_d0e452'] } } + let(:nested_component) { all_components.find { |c| c['id'] == ['ncaids544-test_d0e631'] } } it 'counts child components' do expect(component_with_descendants['child_component_count_isi']).to eq [9] @@ -271,7 +271,7 @@ def components(result) describe 'component-level' do it 'indexes own notes, not notes from descendants' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671'] } expect(component).to include 'scopecontent_html_tesm' expect(component['scopecontent_html_tesm']).to include(a_string_matching(/provide important background context./)) expect(component['scopecontent_html_tesm']).not_to include(a_string_matching(/correspondence, and a nametag./)) @@ -395,7 +395,7 @@ def components(result) let(:component_with_many_parents) { all_components.find { |c| c['ref_ssi'] == ['aspace_f934f1add34289f28bd0feb478e68275'] } } it 'parent_unittitles should be displayable and searchable' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671'] } %w[parent_unittitles_ssm parent_unittitles_tesim].each do |field| expect(component[field]).to contain_exactly( 'Alpha Omega Alpha Archives, 1894-1992' @@ -428,12 +428,12 @@ def components(result) end it 'only indexes containers within a given component' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_843e8f9f22bac69872d0802d6fffbb04'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04'] } expect(component['containers_ssim']).to eq ['box 1', 'folder 1'] end it 'only indexes containers at the same level of the component' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671'] } expect(component['containers_ssim']).to be_nil end end @@ -456,7 +456,7 @@ def components(result) end it 'indexes controlaccess subjects within a component' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_81c806b82a14c3c79d395bbd383b886f'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_81c806b82a14c3c79d395bbd383b886f'] } %w[access_subjects_ssm access_subjects_ssim].each do |field| expect(component).to include field expect(component[field]).to contain_exactly 'Minutes' @@ -510,13 +510,13 @@ def components(result) describe 'component-level' do it 'indexes names in a shared names field' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_843e8f9f22bac69872d0802d6fffbb04'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04'] } expect(component).to include 'names_ssim' expect(component['names_ssim']).to include_ignoring_whitespace 'Robertson\'s Crab House' end it 'indexes names in fields for specific name types, regardless of ' do - component = all_components.find { |c| c['id'] == ['aoa271aspace_843e8f9f22bac69872d0802d6fffbb04'] } + component = all_components.find { |c| c['id'] == ['aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04'] } expect(component['corpname_ssim']).to include_ignoring_whitespace 'Robertson\'s Crab House' expect(component['persname_ssim']).to include_ignoring_whitespace 'Anfinsen, Christian B.' end @@ -529,7 +529,7 @@ def components(result) end it 'indexes geognames' do - component = all_components.find { |d| d['id'] == ['aoa271aspace_843e8f9f22bac69872d0802d6fffbb04'] } + component = all_components.find { |d| d['id'] == ['aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04'] } expect(component).to include 'geogname_ssim' expect(component['geogname_ssim']).to include('Popes Creek (Md.)') @@ -544,7 +544,7 @@ def components(result) end it 'creates date_range_isim' do - component = all_components.find { |d| d['id'] == ['aoa271aspace_563a320bb37d24a9e1e6f7bf95b52671'] } + component = all_components.find { |d| d['id'] == ['aoa271_aspace_563a320bb37d24a9e1e6f7bf95b52671'] } date_range = component['date_range_isim'] expect(date_range).to be_an Array expect(date_range.length).to eq 75 @@ -603,7 +603,7 @@ def components(result) end context 'when is direct child of component' do - let(:component) { all_components.find { |c| c['id'] == ['aoa271aspace_e6db65d47e891d61d69c2798c68a8f02'] } } + let(:component) { all_components.find { |c| c['id'] == ['aoa271_aspace_e6db65d47e891d61d69c2798c68a8f02'] } } it 'gets the digital object' do expect(component['digital_objects_ssm']).to eq( @@ -618,7 +618,7 @@ def components(result) end context 'when is child of the in a component' do - let(:component) { all_components.find { |c| c['id'] == ['aoa271aspace_843e8f9f22bac69872d0802d6fffbb04'] } } + let(:component) { all_components.find { |c| c['id'] == ['aoa271_aspace_843e8f9f22bac69872d0802d6fffbb04'] } } it 'gets the digital objects' do expect(component['digital_objects_ssm']).to eq( @@ -649,10 +649,10 @@ def components(result) expect(all_components).not_to be_empty expect(first_component['ref_ssi']).to contain_exactly('al_4bf70b448ac8351a147acff1dd8b1c0b9a791980') - expect(first_component['id']).to contain_exactly('ehllHemingwayErnest-sampleal_4bf70b448ac8351a147acff1dd8b1c0b9a791980') + expect(first_component['id']).to contain_exactly('ehllHemingwayErnest-sample_al_4bf70b448ac8351a147acff1dd8b1c0b9a791980') expect(second_component['ref_ssi']).to contain_exactly('al_54b06e5ad77cab05ec7f6beeaca50022c47d9c7b') - expect(second_component['id']).to contain_exactly('ehllHemingwayErnest-sampleal_54b06e5ad77cab05ec7f6beeaca50022c47d9c7b') + expect(second_component['id']).to contain_exactly('ehllHemingwayErnest-sample_al_54b06e5ad77cab05ec7f6beeaca50022c47d9c7b') expect(second_component['parent_ssim']).to equal_array_ignoring_whitespace( %w[ehllHemingwayErnest-sample al_4bf70b448ac8351a147acff1dd8b1c0b9a791980] diff --git a/spec/models/arclight/parent_spec.rb b/spec/models/arclight/parent_spec.rb index 3b8a2fc8d..79a1d7f43 100644 --- a/spec/models/arclight/parent_spec.rb +++ b/spec/models/arclight/parent_spec.rb @@ -15,7 +15,7 @@ end it 'returns a correct global identifier' do - expect(instance.global_id).to eq '123abc' + expect(instance.global_id).to eq '123_abc' end end end