diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2016-08-23 15:23:56 -0400 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-10-04 17:23:18 +0100 |
commit | e956a24dfd45baaafe93a520df61015bba40a4da (patch) | |
tree | 453bc7185a0b2f5587207638bc2f6e39143fdda1 /spec/requests/api/projects_spec.rb | |
parent | b6b5033516210fc431a70f729b5678539c039b3f (diff) | |
download | gitlab-ce-e956a24dfd45baaafe93a520df61015bba40a4da.tar.gz |
api: add /projects/visible API endpoint
FIxes #19361, #3119.
Diffstat (limited to 'spec/requests/api/projects_spec.rb')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 4a0d727faea..5bf8b64b84b 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -175,6 +175,17 @@ describe API::API, api: true do end end + describe 'GET /projects/visible' do + let(:public_project) { create(:project, :public) } + + it 'returns the projects viewable by the user' do + get api('/projects/visible', user3) + expect(response).to have_http_status(200) + expect(json_response).to be_an Array + expect(json_response.map { |project| project['id'] }).to contain_exactly(project.id, project2.id, project4.id) + end + end + describe 'GET /projects/starred' do let(:public_project) { create(:project, :public) } |