Skip to content

Commit

Permalink
fix specs, priceton moved loris to https, faraday not redirecting on …
Browse files Browse the repository at this point in the history
…301, change url

update spec to expect regionSquare in supports

start working on as_json
basic spec done

use alias_method instead of redefining as_json and passing args down to to_ordered_hash
move shared examples to spec/support following rspec convention
https://relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples

fix issue with alias_method referring to method in superclass
add as_json example to more specs

move desribe blocks into specs to allow subject to be setup in spec

move back to share_example usign describe block too
require fixed_values for all specs with as_json example

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
  • Loading branch information
ConorSheehan1 committed Oct 4, 2018
1 parent c6c23bf commit c049588
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/integration/iiif/presentation/image_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
let(:image_server) { 'https://libimages.princeton.edu/loris' }

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

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

Expand All @@ -32,19 +32,19 @@
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 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.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 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.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 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 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.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
Expand Down Expand Up @@ -80,8 +80,6 @@
describe 'respects the params we supply' do
it ':resource_id' do
r_id = 'http://example.edu/images/some.jpg'
# 301 moved to
# r_id = 'https://libimages.princeton.edu/loris2/pudl0001/4612422/00000001.jp2/info.json'

opts = { service_id: valid_service_id, resource_id: r_id}
resource = described_class.create_image_api_image_resource(opts)
Expand Down

0 comments on commit c049588

Please sign in to comment.