From 468b2e8e0b46e7a7cee7cc9d9ce9b5c22e79c467 Mon Sep 17 00:00:00 2001 From: Sean Edge Date: Mon, 23 Jun 2014 21:35:36 -0400 Subject: Added annotated tags. Updated tag haml file and call to gitlab-shell. Updated API for annotated tags. Added tests for API. Strip leading/trailing whitespace from message, if present. Update CHANGELOG. --- spec/requests/api/repositories_spec.rb | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'spec/requests/api/repositories_spec.rb') diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb index ffcdbc4255e..3ada945ae05 100644 --- a/spec/requests/api/repositories_spec.rb +++ b/spec/requests/api/repositories_spec.rb @@ -23,12 +23,29 @@ describe API::API, api: true do end describe 'POST /projects/:id/repository/tags' do - it 'should create a new tag' do - post api("/projects/#{project.id}/repository/tags", user), - tag_name: 'v2.0.0', - ref: 'master' - response.status.should == 201 - json_response['name'].should == 'v2.0.0' + context 'lightweight tags' do + it 'should create a new tag' do + post api("/projects/#{project.id}/repository/tags", user), + tag_name: 'v1.0.0', + ref: 'master' + + response.status.should == 201 + json_response['name'].should == 'v1.0.0' + end + end + context 'annotated tag' do + it 'should create a new annotated tag' do + post api("/projects/#{project.id}/repository/tags", user), + tag_name: 'v1.0.0', + ref: 'master', + message: 'tag message' + + response.status.should == 201 + json_response['name'].should == 'v1.0.0' + # The message is not part of the JSON response. + # Additional changes to the gitlab_git gem may be required. + # json_response['message'].should == 'tag message' + end end it 'should deny for user without push access' do -- cgit v1.2.1