diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-13 11:43:17 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-22 10:58:23 -0800 |
commit | 301a30e0ea573c83c28358b2c856396fda878089 (patch) | |
tree | aed16ce1197a8dec29582cc549b7846e188f4271 /spec | |
parent | 1cf45407d3be9e9767d27e55b6f3e2e0d8dea36f (diff) | |
download | gitlab-ce-301a30e0ea573c83c28358b2c856396fda878089.tar.gz |
Add project permissions to all project API endpoints
This standardizes all the project API formats. Also needed to support Huboard.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 01d2ec79482..7f0f9454b10 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -131,6 +131,7 @@ describe API::API, api: true do expect(json_response).to satisfy do |response| response.one? do |entry| + entry.has_key?('permissions') && entry['name'] == project.name && entry['owner']['username'] == user.username end @@ -382,6 +383,18 @@ describe API::API, api: true do end describe 'permissions' do + context 'all projects' do + it 'Contains permission information' do + project.team << [user, :master] + get api("/projects", user) + + expect(response.status).to eq(200) + expect(json_response.first['permissions']['project_access']['access_level']). + to eq(Gitlab::Access::MASTER) + expect(json_response.first['permissions']['group_access']).to be_nil + end + end + context 'personal project' do it 'Sets project access and returns 200' do project.team << [user, :master] |