Skip to content
Snippets Groups Projects
Commit 4dc33357 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

Merge branch 'rspec' of gitlab.c3sl.ufpr.br:portalmec/portalmec into rspec

parents cb7172c6 6ebe7b73
No related branches found
No related tags found
No related merge requests found
......@@ -183,6 +183,22 @@ resource 'Learning Objects' do
end
end
delete '/v1/learning_objects/:learning_object_id/attachment/:attachment_id' do
include_context "authenticate_user"
let(:learning_object_id) { @learning_object.id }
let(:attachment_id) { @learning_object.attachments.first.id }
before do
@learning_object = create(:learning_object, publisher: @user)
@learning_object.attachments << LearningObject::Attachment.create
end
example 'Destroy an attachment (file) of a learning object' do
do_request
expect(status).to eq(200)
end
end
end
......@@ -156,6 +156,21 @@ resource 'Users' do
end
end
get '/v1/users/:id/collections/liked' do
include_context "authenticate_user"
before do
create(:like, user: @user, likeable: create(:collection))
end
let(:id) { @user.id }
example 'Showing a user’s liked collections' do
do_request
expect(status).to eq(200)
end
end
get '/v1/users/:id/learning_objects/liked' do
include_context "authenticate_user"
......@@ -186,6 +201,21 @@ resource 'Users' do
end
end
get '/v1/users/:id/collections' do
include_context "authenticate_user"
before do
create(:collection, owner: @user)
end
let(:id) { @user.id }
example 'Showing a user’s collections' do
do_request
expect(status).to eq(200)
end
end
get '/v1/users/:id/drafts' do
include_context "authenticate_user"
......
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