diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-06 04:36:19 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-06 04:39:36 +0300 |
commit | 631a30276e30354cfde6b759527abbb26ff6cf96 (patch) | |
tree | 783203a3a5a883cd4f917df37cfdb75bed66841d /spec/requests | |
parent | d2f9a9012d55a7dc9c8e9e61b946c52836a1d8f1 (diff) |
Fix API setting of 'public' attribute to false will make a project private
Closes #3864
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index c59ee7af8ab..24b765f4979 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -742,6 +742,18 @@ describe API::API, api: true do end end + it 'should update visibility_level from public to private' do + project3.update_attributes({ visibility_level: Gitlab::VisibilityLevel::PUBLIC }) + + project_param = { public: false } + put api("/projects/#{project3.id}", user), project_param + expect(response.status).to eq(200) + project_param.each_pair do |k, v| + expect(json_response[k.to_s]).to eq(v) + end + expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE) + end + it 'should not update name to existing name' do project_param = { name: project3.name } put api("/projects/#{project.id}", user), project_param |