Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration tests; Fix manifest-level service #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Fixed stale URIs -- Princeton has move to HTTPS, etc
  • Loading branch information
benwbrum committed Oct 3, 2017
commit 89ecaa62c07ea7b977e99dd9cb107699c4194acb
16 changes: 8 additions & 8 deletions spec/integration/iiif/presentation/image_resource_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'pry'
describe IIIF::Presentation::ImageResource do
vcr_options = {
cassette_name: 'pul_loris_cassette',
Expand All @@ -7,15 +8,14 @@

describe 'self#create_image_api_image_resource', vcr: vcr_options do

let(:image_server) { 'http://libimages.princeton.edu/loris2' }

let(:image_server) { 'https://libimages.princeton.edu/loris' }
let(:valid_service_id) {
id = 'pudl0001%2F4612422%2F00000001.jp2'
id = 'pudl0001/4612422/00000001.jp2'
"#{image_server}/#{id}"
}

let(:invalid_service_id) {
id = 'xxxx%2F4612422%2F00000001.jp2'
id = 'xxxx/4612422/00000001.jp2'
"#{image_server}/#{id}"
}

Expand All @@ -31,25 +31,25 @@
resource = described_class.create_image_api_image_resource(opts)
# expect(resource['@context']).to eq 'http://iiif.io/api/presentation/2/context.json'
# @context is only added when we call to_json...
expect(resource['@id']).to eq 'http://libimages.princeton.edu/loris2/pudl0001%2F4612422%2F00000001.jp2/full/!200,200/0/default.jpg'
expect(resource['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.jp2/full/!200,200/0/default.jpg'
expect(resource['@type']).to eq 'dctypes:Image'
expect(resource.format).to eq "image/jpeg"
expect(resource.width).to eq 3047
expect(resource.height).to eq 7200
expect(resource.service['@context']).to eq 'http://iiif.io/api/image/2/context.json'
expect(resource.service['@id']).to eq 'http://libimages.princeton.edu/loris2/pudl0001%2F4612422%2F00000001.jp2'
expect(resource.service['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.jp2'
expect(resource.service['profile']).to eq 'http://iiif.io/api/image/2/level2.json'
end
it 'copies over all teh infos (when copy_info is true)' do
opts = { service_id: valid_service_id, copy_info: true }
resource = described_class.create_image_api_image_resource(opts)
expect(resource['@id']).to eq 'http://libimages.princeton.edu/loris2/pudl0001%2F4612422%2F00000001.jp2/full/!200,200/0/default.jpg'
expect(resource['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.jp2/full/!200,200/0/default.jpg'
expect(resource['@type']).to eq 'dctypes:Image'
expect(resource.format).to eq "image/jpeg"
expect(resource.width).to eq 3047
expect(resource.height).to eq 7200
expect(resource.service['@context']).to eq 'http://iiif.io/api/image/2/context.json'
expect(resource.service['@id']).to eq 'http://libimages.princeton.edu/loris2/pudl0001%2F4612422%2F00000001.jp2'
expect(resource.service['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001%2F4612422%2F00000001.jp2' # I do not know why this would be partially escaped, but I am not Princeton
expect(resource.service['profile']).to eq [
'http://iiif.io/api/image/2/level2.json',
{
Expand Down