Add user to project to see todos

This commit is contained in:
Robert Schilling 2016-06-10 12:24:38 +02:00
parent 39e6f504fc
commit f3abd18c9c
2 changed files with 6 additions and 1 deletions

View file

@ -276,7 +276,7 @@ module API
expose :id
expose :project, using: Entities::BasicProjectDetails
expose :author, using: Entities::UserBasic
expose :action_name
#expose :action_name
expose :target_id
expose :target_type
expose :target_reference do |todo, options|

View file

@ -14,6 +14,11 @@ describe API::Todos, api: true do
let!(:pending_3) { create(:todo, project: project_1, author: author_2, user: john_doe, target: merge_request) }
let!(:done) { create(:todo, :done, project: project_1, author: author_1, user: john_doe) }
before do
project_1.team << [john_doe, :developer]
project_2.team << [john_doe, :developer]
end
describe 'GET /todos' do
context 'when unauthenticated' do
it 'returns authentication error' do