Skip to content

Commit

Permalink
Adding tests for physdesc elements to display feature specs.
Browse files Browse the repository at this point in the history
randalldfloyd committed Dec 14, 2023
1 parent 99c657a commit d57a9c8
Showing 5 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/generators/arclight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
@@ -279,6 +279,7 @@ class CatalogController < ApplicationController
config.add_background_field 'accruals', field: 'accruals_html_tesm', helper_method: :render_html_tags
config.add_background_field 'phystech', field: 'phystech_html_tesm', helper_method: :render_html_tags
config.add_background_field 'physloc', field: 'physloc_html_tesm', helper_method: :render_html_tags
config.add_background_field 'physdesc', field: 'physdesc_tesim', helper_method: :render_html_tags
config.add_background_field 'physfacet', field: 'physfacet_tesim', helper_method: :render_html_tags
config.add_background_field 'dimensions', field: 'dimensions_tesim', helper_method: :render_html_tags
config.add_background_field 'materialspec', field: 'materialspec_tesim', helper_method: :render_html_tags
@@ -337,6 +338,7 @@ class CatalogController < ApplicationController
config.add_component_field 'phystech', field: 'phystech_html_tesm', helper_method: :render_html_tags
config.add_component_field 'materialspec', field: 'materialspec_tesim', helper_method: :render_html_tags
config.add_component_field 'physloc', field: 'physloc_html_tesm', helper_method: :render_html_tags
config.add_component_field 'physdesc', field: 'physdesc_tesim', helper_method: :render_html_tags
config.add_component_field 'physfacet', field: 'physfacet_tesim', helper_method: :render_html_tags
config.add_component_field 'dimensions', field: 'dimensions_tesim', helper_method: :render_html_tags
config.add_component_field 'fileplan', field: 'fileplan_html_tesim', helper_method: :render_html_tags
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ en:
accruals: Accruals
phystech: Physical / technical requirements
physloc: Physical location
physdesc: Physical description
physfacet: Physical facet
dimensions: Dimensions
descrules: Rules or conventions
11 changes: 10 additions & 1 deletion spec/features/collection_page_spec.rb
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@
end
end

it 'background has configured metadata' do
it 'background has configured metadata' do # rubocop:disable RSpec/MultipleExpectations
within '#background' do
expect(page).to have_css('dt', text: 'Scope and content')
expect(page).to have_css('dd', text: /^Correspondence, documents, records, photos/)
@@ -99,6 +99,15 @@
expect(page).to have_css('dt', text: 'Arrangement')
expect(page).to have_css('dd', text: /^Arranged into seven series\./)

expect(page).to have_css('dt', text: 'Physical description')
expect(page).to have_css('dd', text: /^Boxes and folders/)

expect(page).to have_css('dt', text: 'Physical facet')
expect(page).to have_css('dd', text: /^Compact digital disc/)

expect(page).to have_css('dt', text: 'Dimensions')
expect(page).to have_css('dd', text: /^7\.5 x 5\.5 in\./)

expect(page).to have_css('dt', text: 'Rules or conventions')
expect(page).to have_css('dd', text: /^Finding aid prepared using Rules for Archival Description/)
end
11 changes: 11 additions & 0 deletions spec/features/component_page_spec.rb
Original file line number Diff line number Diff line change
@@ -83,6 +83,17 @@
expect(page).to have_css('dd', text: /^These papers were maintained by the staff/)
end

it 'shows configured component fields' do
expect(page).to have_css('dt', text: 'Extent')
expect(page).to have_css('dd', text: /^2 Linear Feet/)
expect(page).to have_css('dt', text: 'Physical description')
expect(page).to have_css('dd', text: /^Mixed Materials/)
expect(page).to have_css('dt', text: 'Dimensions')
expect(page).to have_css('dd', text: /^various/)
expect(page).to have_css('dt', text: 'Physical facet')
expect(page).to have_css('dd', text: /^Boxes and folders/)
end

it 'multivalued notes are rendered as paragaphs' do
within 'dd.blacklight-appraisal' do
expect(page).to have_css('p', count: 2)
10 changes: 10 additions & 0 deletions spec/fixtures/ead/nlm/alphaomegaalpha.xml
Original file line number Diff line number Diff line change
@@ -474,6 +474,16 @@
<did>
<unittitle>Constitution and by-laws - drafts,</unittitle>
<unitdate normal="1902/1904" type="inclusive">1902-1904</unitdate>
<physdesc>
Mixed Materials
</physdesc>
<physdesc>
<physfacet>Boxes and folders</physfacet>
</physdesc>
<physdesc altrender="whole">
<dimensions>various</dimensions>
<extent altrender="materialtype spaceoccupied">2 Linear Feet</extent>
</physdesc>
<container id="aspace_19171bacef2f302c352195eaafca6b75" label="Mixed Materials"
type="box">1</container>
<container id="aspace_4cceb568b39913f2342e43dd3d54b772"

0 comments on commit d57a9c8

Please sign in to comment.