diff options
Diffstat (limited to 'spec/requests/api/tags_spec.rb')
-rw-r--r-- | spec/requests/api/tags_spec.rb | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb index 3c698cf577e..1aa1ad87be9 100644 --- a/spec/requests/api/tags_spec.rb +++ b/spec/requests/api/tags_spec.rb @@ -358,17 +358,6 @@ RSpec.describe API::Tags do expect(json_response['message']).to eq('Target foo is invalid') end - context 'lightweight tags with release notes' do - it 'creates a new tag' do - post api(route, current_user), params: { tag_name: tag_name, ref: 'master', release_description: 'Wow' } - - expect(response).to have_gitlab_http_status(:created) - expect(response).to match_response_schema('public_api/v4/tag') - expect(json_response['name']).to eq(tag_name) - expect(json_response['release']['description']).to eq('Wow') - end - end - context 'annotated tag' do it 'creates a new annotated tag' do # Identity must be set in .gitconfig to create annotated tag. @@ -440,122 +429,4 @@ RSpec.describe API::Tags do end end end - - describe 'POST /projects/:id/repository/tags/:tag_name/release' do - let(:route) { "/projects/#{project_id}/repository/tags/#{tag_name}/release" } - let(:description) { 'Awesome release!' } - - shared_examples_for 'repository new release' do - it 'creates description for existing git tag' do - post api(route, user), params: { description: description } - - expect(response).to have_gitlab_http_status(:created) - expect(response).to match_response_schema('public_api/v4/release/tag_release') - expect(json_response['tag_name']).to eq(tag_name) - expect(json_response['description']).to eq(description) - end - - context 'when tag does not exist' do - let(:tag_name) { 'unknown' } - - it_behaves_like '404 response' do - let(:request) { post api(route, current_user), params: { description: description } } - let(:message) { '404 Tag Not Found' } - end - end - - context 'when repository is disabled' do - include_context 'disabled repository' - - it_behaves_like '403 response' do - let(:request) { post api(route, current_user), params: { description: description } } - end - end - end - - context 'when authenticated', 'as a maintainer' do - let(:current_user) { user } - - it_behaves_like 'repository new release' - - context 'requesting with the escaped project full path' do - let(:project_id) { CGI.escape(project.full_path) } - - it_behaves_like 'repository new release' - end - - context 'on tag with existing release' do - let!(:release) { create(:release, :legacy, project: project, tag: tag_name, description: description) } - - it 'returns 409 if there is already a release' do - post api(route, user), params: { description: description } - - expect(response).to have_gitlab_http_status(:conflict) - expect(json_response['message']).to eq('Release already exists') - end - end - end - end - - describe 'PUT id/repository/tags/:tag_name/release' do - let(:route) { "/projects/#{project_id}/repository/tags/#{tag_name}/release" } - let(:description) { 'Awesome release!' } - let(:new_description) { 'The best release!' } - - shared_examples_for 'repository update release' do - context 'on tag with existing release' do - let!(:release) do - create(:release, - :legacy, - project: project, - tag: tag_name, - description: description) - end - - it 'updates the release description' do - put api(route, current_user), params: { description: new_description } - - expect(response).to have_gitlab_http_status(:ok) - expect(json_response['tag_name']).to eq(tag_name) - expect(json_response['description']).to eq(new_description) - end - end - - context 'when tag does not exist' do - let(:tag_name) { 'unknown' } - - it_behaves_like '403 response' do - let(:request) { put api(route, current_user), params: { description: new_description } } - let(:message) { '403 Forbidden' } - end - end - - context 'when repository is disabled' do - include_context 'disabled repository' - - it_behaves_like '403 response' do - let(:request) { put api(route, current_user), params: { description: new_description } } - end - end - end - - context 'when authenticated', 'as a maintainer' do - let(:current_user) { user } - - it_behaves_like 'repository update release' - - context 'requesting with the escaped project full path' do - let(:project_id) { CGI.escape(project.full_path) } - - it_behaves_like 'repository update release' - end - - context 'when release does not exist' do - it_behaves_like '403 response' do - let(:request) { put api(route, current_user), params: { description: new_description } } - let(:message) { '403 Forbidden' } - end - end - end - end end |