Commit 3162140d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tag tests

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 66516da3
...@@ -41,6 +41,7 @@ module API ...@@ -41,6 +41,7 @@ module API
result = CreateTagService.new.execute(user_project, params[:tag_name], result = CreateTagService.new.execute(user_project, params[:tag_name],
params[:ref], message, params[:ref], message,
current_user) current_user)
if result[:status] == :success if result[:status] == :success
present result[:tag], present result[:tag],
with: Entities::RepoObject, with: Entities::RepoObject,
......
...@@ -33,10 +33,11 @@ describe API::API, api: true do ...@@ -33,10 +33,11 @@ describe API::API, api: true do
json_response['name'].should == 'v1.0.0' json_response['name'].should == 'v1.0.0'
end end
end end
context 'annotated tag' do context 'annotated tag' do
it 'should create a new annotated tag' do it 'should create a new annotated tag' do
post api("/projects/#{project.id}/repository/tags", user), post api("/projects/#{project.id}/repository/tags", user),
tag_name: 'v1.0.0', tag_name: 'v1.1.0',
ref: 'master', ref: 'master',
message: 'tag message' message: 'tag message'
...@@ -50,7 +51,7 @@ describe API::API, api: true do ...@@ -50,7 +51,7 @@ describe API::API, api: true do
it 'should deny for user without push access' do it 'should deny for user without push access' do
post api("/projects/#{project.id}/repository/tags", user2), post api("/projects/#{project.id}/repository/tags", user2),
tag_name: 'v1.0.0', tag_name: 'v1.2.0',
ref: '621491c677087aa243f165eab467bfdfbee00be1' ref: '621491c677087aa243f165eab467bfdfbee00be1'
response.status.should == 403 response.status.should == 403
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment