From d659b736a19ea6283761cf417dcad78470da0978 Mon Sep 17 00:00:00 2001 From: Conor Sheehan Date: Thu, 4 Oct 2018 16:49:07 +0100 Subject: [PATCH] fix specs, priceton moved loris to https * fix specs, priceton moved loris to https, faraday not redirecting on 301, change url update spec to expect regionSquare in supports * revert back to url encoded slashes in spec revert change to hash_behaviours_spec * missed one set of slashes * remove redundant comment --- .../iiif/presentation/image_resource_spec.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spec/integration/iiif/presentation/image_resource_spec.rb b/spec/integration/iiif/presentation/image_resource_spec.rb index e59ad2f..e19a8af 100644 --- a/spec/integration/iiif/presentation/image_resource_spec.rb +++ b/spec/integration/iiif/presentation/image_resource_spec.rb @@ -7,7 +7,8 @@ describe 'self#create_image_api_image_resource', vcr: vcr_options do - let(:image_server) { 'http://libimages.princeton.edu/loris2' } + # 301 moved to https.../loris + let(:image_server) { 'https://libimages.princeton.edu/loris' } let(:valid_service_id) { id = 'pudl0001%2F4612422%2F00000001.jp2' @@ -31,31 +32,31 @@ 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%2F4612422%2F00000001.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' 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 + it 'copies over all the info (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%2F4612422%2F00000001.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' expect(resource.service['profile']).to eq [ 'http://iiif.io/api/image/2/level2.json', { 'supports' => [ 'canonicalLinkHeader', 'profileLinkHeader', 'mirroring', - 'rotationArbitrary', 'sizeAboveFull' + 'rotationArbitrary', 'regionSquare', 'sizeAboveFull' ], 'qualities' => ['default', 'bitonal', 'gray', 'color'], 'formats'=>['jpg', 'png', 'gif', 'webp'] @@ -78,7 +79,8 @@ describe 'respects the params we supply' do it ':resource_id' do - r_id = 'http://example.edu/images/some.jpg' + r_id = 'http://example.edu/images/some.jpg' + opts = { service_id: valid_service_id, resource_id: r_id} resource = described_class.create_image_api_image_resource(opts) expect(resource['@id']).to eq r_id