diff options
author | 🙈 jacopo beschi 🙉 <intrip@gmail.com> | 2018-09-12 20:52:30 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-09-12 20:52:30 +0000 |
commit | 8e52f56d8d1a041716d4ebcf8a42934825a921af (patch) | |
tree | 467b5f55fe9b757959c1e5bd4c281beff163ac14 /spec/requests/api | |
parent | fb81210ba7079ede4451d979b8da92fcdf04a17c (diff) | |
download | gitlab-ce-8e52f56d8d1a041716d4ebcf8a42934825a921af.tar.gz |
Resolve "500 Internal Server Error: Deleting branch of deleted project"
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 65cd423f0bb..c8e98e6024c 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -148,6 +148,16 @@ describe API::Projects do expect(json_response.first.keys).to include('open_issues_count') end + it 'does not include projects marked for deletion' do + project.update(pending_delete: true) + + get api('/projects', user) + + expect(response).to have_gitlab_http_status(200) + expect(json_response).to be_an Array + expect(json_response.map { |p| p['id'] }).not_to include(project.id) + end + it 'does not include open_issues_count if issues are disabled' do project.project_feature.update_attribute(:issues_access_level, ProjectFeature::DISABLED) @@ -1012,6 +1022,15 @@ describe API::Projects do expect(json_response).not_to include("import_error") end + it 'returns 404 when project is marked for deletion' do + project.update(pending_delete: true) + + get api("/projects/#{project.id}", user) + + expect(response).to have_gitlab_http_status(404) + expect(json_response['message']).to eq('404 Project Not Found') + end + context 'links exposure' do it 'exposes related resources full URIs' do get api("/projects/#{project.id}", user) |