diff --git a/config/settings.yml b/config/settings.yml
index 7e462ceb..a5d1f28b 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -36,7 +36,7 @@ releases:
url: 'https://earthworks.stanford.edu/catalog/stanford-%{druid}'
searchworks:
- url: 'https://searchworks.stanford.edu/view/'
+ url: 'https://searchworks.stanford.edu'
landing_page_druids:
- bb112zx3193
diff --git a/spec/fixtures/document_cache/bb/631/ry/3167/mods b/spec/fixtures/document_cache/bb/631/ry/3167/mods
new file mode 100644
index 00000000..6694554b
--- /dev/null
+++ b/spec/fixtures/document_cache/bb/631/ry/3167/mods
@@ -0,0 +1,32 @@
+
+
+
+ Native American Alumni Oral Histories
+
+ mixed material
+
+ eng
+
+
+
+ cau
+
+ monographic
+
+
+ https://purl.stanford.edu/bb631ry3167
+
+
+ Dept. of Special Collections and University Archives Stanford University Libraries Stanford, CA 94305
+
+
+ CSt
+ aacr
+ dacs
+ Converted from MARCXML to MODS version 3.7 using MARC21slim2MODS3-7_SDR_v2-5.xsl (SUL 3.7 version 2.5 20210421; LC Revision 1.140 20200717)
+ 210811
+ a13965062
+
+ The materials are open for research use and may be used freely for non-commercial purposes with an attribution. For commercial permission requests, please contact the Stanford University Archives (universityarchives@stanford.edu).
+ Copyright (c) The Board of Trustees of the Leland Stanford Junior University. All rights reserved.
+
diff --git a/spec/fixtures/document_cache/bb/631/ry/3167/public b/spec/fixtures/document_cache/bb/631/ry/3167/public
new file mode 100644
index 00000000..773a06da
--- /dev/null
+++ b/spec/fixtures/document_cache/bb/631/ry/3167/public
@@ -0,0 +1,73 @@
+
+
+
+ collection
+ Native American Alumni Oral Histories
+ 13965062
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Copyright (c) The Board of Trustees of the Leland Stanford Junior University. All rights reserved.
+
+
+
+
+
+
+
+
+
+ Native American Alumni Oral Histories
+ Collection
+ eng
+ https://purl.stanford.edu/bb631ry3167
+
+
+
+ Native American Alumni Oral Histories
+
+ mixed material
+
+ eng
+
+
+
+ cau
+
+ monographic
+
+
+ https://purl.stanford.edu/bb631ry3167
+
+
+ Dept. of Special Collections and University Archives Stanford University Libraries Stanford, CA 94305
+
+
+ CSt
+ aacr
+ dacs
+ Converted from MARCXML to MODS version 3.7 using MARC21slim2MODS3-7_SDR_v2-5.xsl (SUL 3.7 version 2.5 20210421; LC Revision 1.140 20200717)
+ 210811
+ a13965062
+
+ The materials are open for research use and may be used freely for non-commercial purposes with an attribution. For commercial permission requests, please contact the Stanford University Archives (universityarchives@stanford.edu).
+ Copyright (c) The Board of Trustees of the Leland Stanford Junior University. All rights reserved.
+
+
+ true
+
+
diff --git a/spec/fixtures/document_cache/gk/894/yk/3598/public b/spec/fixtures/document_cache/gk/894/yk/3598/public
new file mode 100644
index 00000000..95eea3b8
--- /dev/null
+++ b/spec/fixtures/document_cache/gk/894/yk/3598/public
@@ -0,0 +1,52 @@
+
+
+
+ collection
+ Acquisitions Serials
+ Hydrus:collection-amanheim-2017-05-12T20:11:22.791Z
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Acquisitions Serials
+ Collection
+ Collection to load serial titles in digital format into the SDR.
+ https://purl.stanford.edu/gk894yk3598
+ amanheim@stanford.edu
+
+
+
+ Acquisitions Serials
+
+ mixed material
+ Collection to load serial titles in digital format into the SDR.
+
+ https://purl.stanford.edu/gk894yk3598
+
+ amanheim@stanford.edu
+ User agrees that, where applicable, content will not be used to identify or to otherwise infringe the privacy or confidentiality rights of individuals. Content distributed via the Stanford Digital Repository may be subject to additional license and use restrictions applied by the depositor.
+
+
+ false
+
+
diff --git a/spec/integration/purl_spec.rb b/spec/integration/purl_spec.rb
index b1a4074b..d6912986 100644
--- a/spec/integration/purl_spec.rb
+++ b/spec/integration/purl_spec.rb
@@ -10,6 +10,7 @@
@unpublished_object = 'ab123cd4567'
@legacy_object = 'ir:rs276tc2764'
@nested_resources_object = 'dm907qj6498'
+ @collection = 'bb631ry3167'
end
describe 'manifest' do
@@ -206,6 +207,14 @@
end
end
+ describe 'items in collection' do
+ it 'included in purl page' do
+ visit "/#{@collection}"
+ expect(page).to have_content 'Items in collection'
+ expect(page).to have_content 'View items in this collection in SearchWorks'
+ end
+ end
+
describe '/status (app monitoring)' do
it 'has response code 200' do
visit '/status'
diff --git a/spec/model/purl_resource_spec.rb b/spec/model/purl_resource_spec.rb
index 119b0c32..355bf251 100644
--- a/spec/model/purl_resource_spec.rb
+++ b/spec/model/purl_resource_spec.rb
@@ -291,4 +291,20 @@
end
end
end
+
+ describe '#object_type' do
+ it 'pulls the value from the identity metadata' do
+ allow(subject).to receive(:public_xml_body).and_return <<-EOF
+
+
+
+ collection
+ Acquisitions Serials
+
+
+ EOF
+
+ expect(subject.object_type).to eq 'collection'
+ end
+ end
end
diff --git a/spec/views/purl/_collection_items.html.erb_spec.rb b/spec/views/purl/_collection_items.html.erb_spec.rb
new file mode 100644
index 00000000..a0747eee
--- /dev/null
+++ b/spec/views/purl/_collection_items.html.erb_spec.rb
@@ -0,0 +1,35 @@
+require 'rails_helper'
+
+RSpec.describe 'purl/_collection_items' do
+ before do
+ assign(:purl, purl)
+ end
+
+ context 'when collection has a catalog record id' do
+ let(:purl) { PurlResource.new(id: 'bb631ry3167') }
+
+ it 'displays a View items in this collection link' do
+ render
+ expect(rendered).to have_css 'a[href="https://searchworks.stanford.edu/catalog?f[collection][]=13965062"]',
+ text: 'View items in this collection in SearchWorks'
+ end
+ end
+
+ context 'when collection does not have a catalog record id' do
+ let(:purl) { PurlResource.new(id: 'gk894yk3598') }
+
+ it 'does not display View items in this collection link' do
+ render
+ expect(rendered).not_to have_css 'a'
+ end
+ end
+
+ context 'when not a collection' do
+ let(:purl) { PurlResource.new(id: 'cg357zz0321') }
+
+ it 'does not display View items in this collection link' do
+ render
+ expect(rendered).not_to have_css 'a'
+ end
+ end
+end