fixing retrieve method name

parent 3de034fb
......@@ -25,7 +25,7 @@ module Dspace
end
end
action :retrive, 'GET /rest/bitstreams/:id/retrieve' do
action :retrieve, 'GET /rest/bitstreams/:id/retrieve' do
handler(200) { |response| response.body }
end
......@@ -55,7 +55,7 @@ module Dspace
def retrieve(args={})
bitstream = ResourceKit::ActionInvoker.call(action(:find), self, id: args.fetch(:id))
Dspace::Builders::TempfileBuilder.build(bitstream.name, ResourceKit::ActionInvoker.call(action(:retrive), self))
Dspace::Builders::TempfileBuilder.build(bitstream.name, ResourceKit::ActionInvoker.call(action(:retrieve), self))
end
end
......
......@@ -21,6 +21,12 @@ RSpec.describe Dspace::Resources::BitstreamResource, resource_kit: true do
end
end
it 'retrive bitstream' do
expect(resource).to have_action(:retrieve).that_handles(200).at_path('/rest/bitstreams/:id/retrieve').with_verb(:get)
#TODO: mock actions expectations for test if retrieve method returns a Tempfile
end
context 'Bitstream scope' do
it 'find bitstream policy' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment