Skip to content
Snippets Groups Projects
Commit 5b79f2d5 authored by Giovanne Marcelo's avatar Giovanne Marcelo
Browse files

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

parents 109c163d 1b37d542
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,13 @@ require 'acceptance_helpers'
require 'shared/contexts'
resource 'Bookmarks' do
header 'Accept', 'application/json'
header 'Content-Type', 'application/json'
before { 12.times { create(:learning_object) } }
let(:bookmarks) { Bookmark.all }
let(:learning_objects) { LearningObject.all }
get '/v1/users/:user_id/bookmarks' do
include_context "authenticate_user"
......@@ -20,4 +26,21 @@ resource 'Bookmarks' do
end
end
post 'v1/users/:user_id/bookmarks' do
include_context "authenticate_user"
parameter :user_id, 'The user id'
parameter :id, 'The id of the object', scope: :bookmarks
parameter :type, 'Represents the type of bookmark, [ LearningObject, Collection]', scope: :bookmarks
let(:user_id) { @user.id }
let(:id) { learning_objects.first.id }
let(:type) { 'LearningObject' }
let(:raw_post) { params.to_json }
example_request 'Adding a bookmark' do
expect(status).to eq(201)
end
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