|
147 | 147 | end |
148 | 148 |
|
149 | 149 | describe 'image requests for world readable items' do |
| 150 | + let(:image_path_component) { "bb%2F000%2Fcr%2F7262%2Fbb000cr7262%2Fcontent%2F8ff299eda08d7c506273840d52a03bf3" } |
| 151 | + |
150 | 152 | context 'when the request is valid' do |
151 | 153 | before do |
152 | | - stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_server_path('bb000cr7262', 'image.jp2')}/0,640,2552,2552/100,100/0/default.jpg") |
| 154 | + stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_path_component}/0,640,2552,2552/100,100/0/default.jpg") |
153 | 155 | .to_return(status: 200, body: "") |
154 | 156 | end |
155 | 157 |
|
|
163 | 165 |
|
164 | 166 | context 'when additional params are provided' do |
165 | 167 | before do |
166 | | - stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_server_path('bb000cr7262', 'image.jp2')}/0,640,2552,2552/100,100/0/default.jpg") |
| 168 | + stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_path_component}/0,640,2552,2552/100,100/0/default.jpg") |
167 | 169 | .to_return(status: 200, body: "") |
168 | 170 | end |
169 | 171 |
|
|
176 | 178 |
|
177 | 179 | context 'when image is missing' do |
178 | 180 | before do |
179 | | - stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_server_path('bb000cr7262', 'image.jp2')}/0,640,2552,2552/100,100/0/default.jpg") |
| 181 | + stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_path_component}/0,640,2552,2552/100,100/0/default.jpg") |
180 | 182 | .to_return(status: 404, body: "") |
181 | 183 | end |
182 | 184 |
|
|
201 | 203 |
|
202 | 204 | context 'with the download flag set' do |
203 | 205 | before do |
204 | | - stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_server_path('bb000cr7262', 'image.jp2')}/0,640,2552,2552/100,100/0/default.jpg") |
| 206 | + stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_path_component}/0,640,2552,2552/100,100/0/default.jpg") |
205 | 207 | .to_return(status: 200, body: "") |
206 | 208 | end |
207 | 209 |
|
|
215 | 217 |
|
216 | 218 | context 'with a pct region' do |
217 | 219 | before do |
218 | | - stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_server_path('bb000cr7262', 'image.jp2')}/pct:3.0,3.0,77.0,77.0/full/0/default.jpg") |
| 220 | + stub_request(:get, "http://imageserver-prod.stanford.edu/iiif/2/#{image_path_component}/pct:3.0,3.0,77.0,77.0/full/0/default.jpg") |
219 | 221 | .to_return(status: 200, body: "") |
220 | 222 | end |
221 | 223 |
|
|
0 commit comments