Skip to content
Snippets Groups Projects
Commit ac226e2c authored by Clarissa's avatar Clarissa
Browse files

#228: Download to documentation; with status 302

parent 4a652755
No related branches found
No related tags found
No related merge requests found
require 'acceptance_helpers'
require 'shared/contexts'
resource 'Downloads' do
explanation "An user can download the content of a learning object or collection."
get '/v1/:type/:id/download' do
include_context "authenticate_user"
parameter :type, "Represents the type of object [‘learning_objects’,'collections']", scope: :download
parameter :id, "The id of object", scope: :download
let(:type) { 'learning_objects' }
let(:id) { @learning_object.id }
before do
@learning_object = create(:learning_object, publisher: @user)
create(:attachment, learning_object: @learning_object)
end
example_request 'Download an object' do
expect(status).to eq(302)
end
end
end
FactoryGirl.define do
factory :attachment, class: LearningObject::Attachment do |f|
f.name { Faker::Name.name }
f.retrieve_link { Faker::File.file_name }
f.mime_type { Faker::File.mime_type }
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment