Skip to content

Commit

Permalink
Fixes #50: undefined method merge for struct Riiif::ImageInformation
Browse files Browse the repository at this point in the history
  • Loading branch information
bess committed Mar 16, 2017
1 parent e052ecb commit 997c8de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/riiif/images_controller.rb
Expand Up @@ -32,7 +32,7 @@ def info
image = model.new(image_id)
if authorization_service.can?(:info, image)
headers['Access-Control-Allow-Origin'] = '*'
render json: image.info.merge(server_info), content_type: 'application/ld+json'
render json: image.info.to_h.merge(server_info), content_type: 'application/ld+json'
else
render json: { error: 'unauthorized' }, status: :unauthorized
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/riiif/images_controller_spec.rb
Expand Up @@ -102,7 +102,7 @@
it 'returns info' do
image = double
expect(Riiif::Image).to receive(:new).with('abcd1234').and_return(image)
expect(image).to receive(:info).and_return(width: 6000, height: 4000)
expect(image).to receive(:info).and_return(Riiif::ImageInformation.new(6000, 4000))
get :info, params: { id: 'abcd1234', format: 'json' }
expect(response).to be_successful
json = JSON.parse(response.body)
Expand Down

0 comments on commit 997c8de

Please sign in to comment.