Skip to content

Commit

Permalink
all existing specs passing
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenenglish committed Sep 21, 2021
1 parent 255471f commit 3bc6b0f
Show file tree
Hide file tree
Showing 175 changed files with 4,845 additions and 1,384 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
module CommonwealthVlrEngine
module ImagesHelperBehavior
# return the image url for the collection gallery view document
# size = pixel length of square IIIF-created image
# @param document [SolrDocument] = Curator::Collection Solr document
# @param size [String] = pixel length of square IIIF-created image
# @return [String]
def collection_gallery_url(document, size)
exemplary_image_pid = document[:exemplary_image_ssi]
if exemplary_image_pid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def coordinates
return default unless matches

term_coords_array = matches.values.flatten(1)[hl_index]
return default unless djvu_coords_array
return default unless term_coords_array

width = term_coords_array[2] - term_coords_array[0]
height = term_coords_array[1] - term_coords_array[3]
Expand Down
2 changes: 1 addition & 1 deletion lib/commonwealth-vlr-engine/iiif_manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def collection_for_manifests(document, manifest_docs)
collection.metadata = manifest_metadata(document)
collection.description = 'This document describes an IIIF Collection, which points to a series of IIIF Manifests comprising the individual items in this multi-volume work'
if document[:license_ss]
collection.license = cc_url(license) if license.match?(/\(CC\s/)
collection.license = cc_url(document[:license_ss]) if document[:license_ss].match?(/\(CC\s/)
end
collection.thumbnail = "#{document[:identifier_uri_ss]}/thumbnail" if document[:exemplary_image_ssi]
manifest_docs.each do |manifest_doc|
Expand Down
8 changes: 5 additions & 3 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
before(:each) { get :metadata_view, params: { id: 'bpl-dev:h702q6403' } }

it 'responds to the #metadata_view action' do
expect(response).to be_successful
expect(assigns(:document)).to_not be_nil
# expect(response).to be_successful
# expect(assigns(:document)).to_not be_nil
skip('XML serialization not yet supported by Curator')
end

it 'renders the page' do
expect(response.body).to include('<mods:title>Beauregard</mods:title>')
# expect(response.body).to include('<mods:title>Beauregard</mods:title>')
skip('XML serialization is not yet available')
end
end

Expand Down
9 changes: 6 additions & 3 deletions spec/controllers/collections_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

it 'should set @collection_image_info' do
expect(assigns(:collection_image_info)).to eq(
{ image_pid: 'bpl-dev:h702q642n', title: 'Beauregard', pid: 'bpl-dev:h702q6403', access_master: true }
{ image_pid: 'bpl-dev:h702q642n', title: 'Beauregard', pid: 'bpl-dev:h702q6403', access_master: true,
hosting_status: 'hosted', image_key: 'images/bpl-dev:h702q642n' }
)
end

Expand Down Expand Up @@ -106,8 +107,10 @@
describe 'collection_image_info' do
let(:collection_image_pid) { 'bpl-dev:h702q642n' }
it 'returns a hash with the collection image object title and pid' do
expect(mock_controller.send(:collection_image_info, collection_image_pid, collection_pid)).to eq(
{ image_pid: collection_image_pid, title: 'Beauregard', pid: 'bpl-dev:h702q6403', access_master: true }
expect(mock_controller.send(:collection_image_info, collection_image_pid, "images/#{collection_image_pid}",
collection_pid, 'hosted')).to eq(
{ image_pid: collection_image_pid, title: 'Beauregard', pid: 'bpl-dev:h702q6403', access_master: true,
hosting_status: 'hosted', image_key: 'images/bpl-dev:h702q642n' }
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/downloads_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
render_views

let(:item_id) { 'bpl-dev:h702q6403' }
let(:filestream_id) { 'access800' }
let(:filestream_id) { 'image_access_800' }
let(:first_image_pid) { 'bpl-dev:h702q641c' }

describe "GET 'show'" do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/more_like_this_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
end

it 'should show the correct item count' do
expect(page).to have_selector('.page-links strong:last-of-type', text: '5')
expect(page).to have_selector('.page-links strong:last-of-type', text: '4')
end
end
end
110 changes: 108 additions & 2 deletions spec/fixtures/sample_solr_documents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@
- complete
exemplary_image_ssi:
- bpl-dev:df65v791t
exemplary_image_key_base_ss:
- images/bpl-dev:df65v791t
destination_site_ssim:
- commonwealth
- bpl
- nblmc
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-24T14:11:57.513Z'
- system_create_dtsi:
Expand Down Expand Up @@ -333,11 +337,15 @@
- complete
exemplary_image_ssi:
- bpl-dev:h702q641c
exemplary_image_key_base_ss:
- images/bpl-dev:h702q641c
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-24T14:11:28.285Z'
- system_create_dtsi:
Expand Down Expand Up @@ -505,11 +513,15 @@
- complete
exemplary_image_ssi:
- bpl-dev:g445cd17d
exemplary_image_key_base_ss:
- images/bpl-dev:g445cd17d
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
flagged_content_ssi:
- offensive
timestamp:
Expand Down Expand Up @@ -690,6 +702,8 @@
- complete
exemplary_image_ssi:
- bpl-dev:000000086
exemplary_image_key_base_ss:
- images/bpl-dev:000000086
flagged_content_ssi:
- explicit
destination_site_ssim:
Expand All @@ -698,6 +712,8 @@
- nblmc
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-24T14:11:52.72Z'
- system_create_dtsi:
Expand Down Expand Up @@ -765,12 +781,16 @@
- bpl-dev:abcd12345
exemplary_image_ssi:
- bpl-dev:df65v791t
exemplary_image_key_base_ss:
- images/bpl-dev:df65v791t
destination_site_ssim:
- commonwealth
- bpl
- nblmc
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-02-18T18:31:16.934Z'
- system_create_dtsi:
Expand Down Expand Up @@ -811,11 +831,15 @@
- bpl-dev:abcd12345
exemplary_image_ssi:
- bpl-dev:h702q642n
exemplary_image_key_base_ss:
- images/bpl-dev:h702q642n
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-05-06T18:30:27.934Z'
- system_create_dtsi:
Expand Down Expand Up @@ -854,11 +878,15 @@
- bpl-dev:abcd12345
exemplary_image_ssi:
- bpl-dev:g445cd17d
exemplary_image_key_base_ss:
- images/bpl-dev:g445cd17d
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-28T16:56:49.037Z'
- system_create_dtsi:
Expand Down Expand Up @@ -897,11 +925,15 @@
- bpl-dev:abcd12345
exemplary_image_ssi:
- bpl-dev:g445cd17d
exemplary_image_key_base_ss:
- images/bpl-dev:g445cd17d
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-28T16:56:47.692Z'
- system_create_dtsi:
Expand All @@ -926,7 +958,7 @@
publishing_state_ssi:
- published
abstract_tsi:
- "Four loko ennui skateboard anim. Id asymmetrical artisan post-ironic, disrupt cornhole messenger bag deep v lo-fi ea. Roof party ea mustache direct trade semiotics hella. Sustainable elit art party fap. Migas cillum XOXO, Odd Future asymmetrical trust fund slow-carb fixie.<br/><br/>Deep v artisan retro, <em>gastropub</em> vero cliche you probably haven't heard of them master cleanse DIY aliquip chia velit hashtag <strong>Thundercats</strong>. Dolore four loko Etsy gastropub anim ut."
- "Four loko ennui skateboard anim. Id asymmetrical artisan post-ironic, disrupt cornhole messenger bag deep v lo-fi ea. Roof party ea mustache direct trade semiotics hella. Sustainable elit art party fap. Migas cillum XOXO, Odd Future asymmetrical trust fund slow-carb fixie.<br/><br/>Deep v artisan retro, <em>gastropub</em> vero cliche you probably haven't heard of them master cleanse DIY aliquip chia velit hashtag <strong>Thundercats</strong>. Dolore four loko Etsy gastropub anim ut.<br/><br/>Freegan twee art party, microdosing neutra tbh quinoa hashtag man bun voluptate veniam dreamcatcher copper mug heirloom."
institution_url_ss:
- http://www.bpl.org/
subject_geo_country_sim:
Expand Down Expand Up @@ -1110,12 +1142,16 @@
- complete
exemplary_image_ssi:
- bpl-dev:000000043
exemplary_image_key_base_ss:
- images/bpl-dev:000000043
destination_site_ssim:
- commonwealth
- bpl
- nblmc
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-24T14:11:56.036Z'
- system_create_dtsi:
Expand Down Expand Up @@ -1242,12 +1278,16 @@
- complete
exemplary_image_ssi:
- bpl-dev:qf85nb29f
exemplary_image_key_base_ss:
- images/bpl-dev:qf85nb29f
destination_site_ssim:
- commonwealth
- bpl
- nblmc
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-24T14:12:04.869Z'
- system_create_dtsi:
Expand Down Expand Up @@ -1370,12 +1410,16 @@
- complete
exemplary_image_ssi:
- bpl-dev:df65v789s
exemplary_image_key_base_ss:
- images/bpl-dev:df65v789s
destination_site_ssim:
- commonwealth
- bpl
- nblmc
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-07-24T14:11:53.292Z'
- system_create_dtsi:
Expand Down Expand Up @@ -1573,13 +1617,17 @@
- complete
exemplary_image_ssi:
- bpl-dev:7s75dn55t
exemplary_image_key_base_ss:
- images/bpl-dev:7s75dn55t
text_direction_ssi:
- ltr
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-11-18T21:22:14.23Z'
- system_create_dtsi:
Expand Down Expand Up @@ -1690,13 +1738,17 @@
- complete
exemplary_image_ssi:
- bpl-dev:3j3346146
exemplary_image_key_base_ss:
- images/bpl-dev:3j3346146
text_direction_ssi:
- ltr
destination_site_ssim:
- commonwealth
- bpl
harvesting_status_bsi:
- true
hosting_status_ssi:
- hosted
timestamp:
- '2015-11-18T19:32:49.014Z'
- system_create_dtsi:
Expand Down Expand Up @@ -1805,6 +1857,8 @@
- complete
exemplary_image_ssi:
- bpl-dev:rf55z9600
exemplary_image_key_base_ss:
- images/bpl-dev:rf55z9600
text_direction_ssi:
- ltr
timestamp:
Expand Down Expand Up @@ -2161,4 +2215,56 @@
has_ocr_text_bsi:
- true
timestamp:
- '2015-11-24T21:09:44.574Z'
- '2015-11-24T21:09:44.574Z'
- id:
- bpl-dev:ff365636z
system_create_dtsi:
- '2019-01-29T15:23:25Z'
system_modified_dtsi:
- '2021-08-17T16:26:07Z'
curator_model_ssi:
- Curator::Filestreams::Document
curator_model_suffix_ssi:
- Document
processing_state_ssi:
- complete
attachments_ss:
- "{\"characterization\":{\"filename\":\"characterization.xml\",\"byte_size\":2747,\"content_type\":\"text/xml\",\"checksum\":\"4p2ZLNXl6maKzLWrN+YSGQ==\",\"key\":\"documents/bpl-dev:ff365636z/characterization.xml\",\"service_name\":\"derivatives\"},\"metadata_foxml\":{\"filename\":\"metadata_foxml.xml\",\"byte_size\":8145,\"content_type\":\"application/xml\",\"checksum\":\"Qq5ypD6FvI/ie3Cn8+OKXg==\",\"key\":\"documents/bpl-dev:ff365636z/metadata_foxml.xml\",\"service_name\":\"primary\"},\"text_plain\":{\"filename\":\"FreemensOath-Transcription.txt\",\"byte_size\":3879,\"content_type\":\"text/plain\",\"checksum\":\"7NDAnhFcOC991YFlxZ7BHA==\",\"key\":\"documents/bpl-dev:ff365636z/text_plain.txt\",\"service_name\":\"derivatives\"}}"
storage_key_base_ss:
- documents/bpl-dev:ff365636z
is_file_set_of_ssim:
- bpl-dev:ff365631k
filename_base_ssi:
- FreemensOath-Transcription
position_isi:
- 0
has_ocr_text_bsi:
- true
ocr_tsiv:
- "The Oath of ffreemen : I A : B : &c : beinge beinge by the Allmightyes most wise despositio"
timestamp:
- '2021-08-17T16:26:07.960Z'
- id:
- bpl-dev:cj82k895q
system_create_dtsi:
- '2020-01-13T18:21:23Z'
system_modified_dtsi:
- '2021-08-17T16:56:45Z'
curator_model_ssi:
- Curator::Filestreams::Video
curator_model_suffix_ssi:
- Video
processing_state_ssi:
- complete
attachments_ss:
- "{\"characterization\":{\"filename\":\"characterization.xml\",\"byte_size\":5911,\"content_type\":\"text/xml\",\"checksum\":\"9eorcedUqXZvlC4Txs7yJg==\",\"key\":\"videos/bpl-dev:cj82k895q/characterization.xml\",\"service_name\":\"derivatives\"},\"image_thumbnail_300\":{\"filename\":\"image_thumbnail_300.jpg\",\"byte_size\":5680,\"content_type\":\"image/jpeg\",\"checksum\":\"P1f2RcLCYdfgPm8PV2VVCw==\",\"key\":\"videos/bpl-dev:cj82k895q/image_thumbnail_300.jpg\",\"service_name\":\"derivatives\"},\"metadata_foxml\":{\"filename\":\"metadata_foxml.xml\",\"byte_size\":17448,\"content_type\":\"application/xml\",\"checksum\":\"1jcMoreJvrcI433U/7IbUg==\",\"key\":\"videos/bpl-dev:cj82k895q/metadata_foxml.xml\",\"service_name\":\"primary\"},\"video_access_mp4\":{\"filename\":\"39999074400019_0.mp4\",\"byte_size\":35421704,\"content_type\":\"video/mp4\",\"checksum\":\"w2opK8klQb3Q+5jcsQ/+IA==\",\"key\":\"videos/bpl-dev:cj82k895q/video_access_mp4.mp4\",\"service_name\":\"derivatives\"},\"video_primary\":{\"filename\":\"39999074400019_0.mov\",\"byte_size\":13920610051,\"content_type\":\"video/quicktime\",\"checksum\":\"kCrfC5IsfJN89F3ZsNKRDA==\",\"key\":\"videos/bpl-dev:cj82k895q/video_primary.mov\",\"service_name\":\"primary\"}}"
storage_key_base_ss:
- videos/bpl-dev:cj82k895q
is_file_set_of_ssim:
- bpl-dev:cj82k894f
filename_base_ssi:
- 39999074400019_0
position_isi:
- 0
timestamp:
- '2021-08-17T16:56:45.430Z'
Loading

0 comments on commit 3bc6b0f

Please sign in to comment.