|
11 | 11 | let(:image_server) { 'https://libimages.princeton.edu/loris' } |
12 | 12 |
|
13 | 13 | let(:valid_service_id) { |
14 | | - id = 'pudl0001/4612422/00000001.jp2' |
| 14 | + id = 'pudl0001%2F4612422%2F00000001.jp2' |
15 | 15 | "#{image_server}/#{id}" |
16 | 16 | } |
17 | 17 |
|
18 | 18 | let(:invalid_service_id) { |
19 | | - id = 'xxxx/4612422/00000001.jp2' |
| 19 | + id = 'xxxx%2F4612422%2F00000001.jp2' |
20 | 20 | "#{image_server}/#{id}" |
21 | 21 | } |
22 | 22 |
|
|
32 | 32 | resource = described_class.create_image_api_image_resource(opts) |
33 | 33 | # expect(resource['@context']).to eq 'http://iiif.io/api/presentation/2/context.json' |
34 | 34 | # @context is only added when we call to_json... |
35 | | - expect(resource['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.jp2/full/!200,200/0/default.jpg' |
| 35 | + expect(resource['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001%2F4612422%2F00000001.jp2/full/!200,200/0/default.jpg' |
36 | 36 | expect(resource['@type']).to eq 'dctypes:Image' |
37 | 37 | expect(resource.format).to eq "image/jpeg" |
38 | 38 | expect(resource.width).to eq 3047 |
39 | 39 | expect(resource.height).to eq 7200 |
40 | 40 | expect(resource.service['@context']).to eq 'http://iiif.io/api/image/2/context.json' |
41 | | - expect(resource.service['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.jp2' |
| 41 | + expect(resource.service['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001%2F4612422%2F00000001.jp2' |
42 | 42 | expect(resource.service['profile']).to eq 'http://iiif.io/api/image/2/level2.json' |
43 | 43 | end |
44 | 44 | it 'copies over all the info (when copy_info is true)' do |
45 | 45 | opts = { service_id: valid_service_id, copy_info: true } |
46 | 46 | resource = described_class.create_image_api_image_resource(opts) |
47 | | - expect(resource['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001/4612422/00000001.jp2/full/!200,200/0/default.jpg' |
| 47 | + expect(resource['@id']).to eq 'https://libimages.princeton.edu/loris/pudl0001%2F4612422%2F00000001.jp2/full/!200,200/0/default.jpg' |
48 | 48 | expect(resource['@type']).to eq 'dctypes:Image' |
49 | 49 | expect(resource.format).to eq "image/jpeg" |
50 | 50 | expect(resource.width).to eq 3047 |
|
80 | 80 | describe 'respects the params we supply' do |
81 | 81 | it ':resource_id' do |
82 | 82 | r_id = 'http://example.edu/images/some.jpg' |
83 | | - # 301 moved to |
84 | | - # r_id = 'https://libimages.princeton.edu/loris2/pudl0001/4612422/00000001.jp2/info.json' |
85 | 83 |
|
86 | 84 | opts = { service_id: valid_service_id, resource_id: r_id} |
87 | 85 | resource = described_class.create_image_api_image_resource(opts) |
|
0 commit comments