diff options
Diffstat (limited to 'spec/requests/api/releases_spec.rb')
-rw-r--r-- | spec/requests/api/releases_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/requests/api/releases_spec.rb b/spec/requests/api/releases_spec.rb index 81a4fcdbcac..8aec18c9c1b 100644 --- a/spec/requests/api/releases_spec.rb +++ b/spec/requests/api/releases_spec.rb @@ -463,9 +463,23 @@ RSpec.describe API::Releases do end context 'when specified tag is not found in the project' do - it 'cannot find the release entry' do + it 'returns 404 for maintater' do get api("/projects/#{project.id}/releases/non_exist_tag", maintainer) + expect(response).to have_gitlab_http_status(:not_found) + expect(json_response['message']).to eq('404 Not Found') + end + + it 'returns project not found for no user' do + get api("/projects/#{project.id}/releases/non_exist_tag", nil) + + expect(response).to have_gitlab_http_status(:not_found) + expect(json_response['message']).to eq('404 Project Not Found') + end + + it 'returns forbidden for guest' do + get api("/projects/#{project.id}/releases/non_existing_tag", guest) + expect(response).to have_gitlab_http_status(:forbidden) end end |