Commit 446e920a authored by Sean Edge's avatar Sean Edge

Add tests for creating tag with API.

parent 2490cfbc
......@@ -23,6 +23,25 @@ describe API::API, api: true do
end
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: 'v1.0.0',
ref: '621491c677087aa243f165eab467bfdfbee00be1'
response.status.should == 201
json_response.first['name'].should == 'v1.0.0'
json_response['commit']['id'].should == '621491c677087aa243f165eab467bfdfbee00be1'
end
it "should deny for user without push access" do
post api("/projects/#{project.id}/repository/tags", user2),
tag_name: 'v1.0.0',
ref: '621491c677087aa243f165eab467bfdfbee00be1'
response.status.should == 403
end
end
describe "GET /projects/:id/repository/tree" do
context "authorized user" do
before { project.team << [user2, :reporter] }
......
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