Skip to content

Commit

Permalink
Merge pull request #51 from curationexperts/no_merge_method_bug
Browse files Browse the repository at this point in the history
Fixes #50: undefined method merge for struct Riiif::ImageInformation
  • Loading branch information
bess authored Mar 16, 2017
2 parents e052ecb + 997c8de commit 6d1b816
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 6d1b816

Please sign in to comment.