summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-05 09:36:11 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-05 09:36:11 +0300
commit3162140dfa30350a15caba662884ea9a24357ae9 (patch)
treeef3984a5bf134461e3fd9e76ccba79baaad9b7d8
parent66516da3c1d7a5fda7876b564a7be00b17d38d25 (diff)
downloadgitlab-ce-3162140dfa30350a15caba662884ea9a24357ae9.tar.gz
Fix tag tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--lib/api/repositories.rb1
-rw-r--r--spec/requests/api/repositories_spec.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index ce89177ef65..07c29aa7b4c 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -41,6 +41,7 @@ module API
result = CreateTagService.new.execute(user_project, params[:tag_name],
params[:ref], message,
current_user)
+
if result[:status] == :success
present result[:tag],
with: Entities::RepoObject,
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb
index 3ada945ae05..9af5c552b10 100644
--- a/spec/requests/api/repositories_spec.rb
+++ b/spec/requests/api/repositories_spec.rb
@@ -33,10 +33,11 @@ describe API::API, api: true do
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',
+ tag_name: 'v1.1.0',
ref: 'master',
message: 'tag message'
@@ -50,7 +51,7 @@ describe API::API, api: true do
it 'should deny for user without push access' do
post api("/projects/#{project.id}/repository/tags", user2),
- tag_name: 'v1.0.0',
+ tag_name: 'v1.2.0',
ref: '621491c677087aa243f165eab467bfdfbee00be1'
response.status.should == 403
end