diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 15:37:42 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 15:37:42 +0300 |
commit | 6fdd9008272f268b05aa498a79dc200da52f7bbc (patch) | |
tree | 1283fe1d7b648f945e5ca97be2dffbbc911fe922 /spec | |
parent | ec837932d0296e06ec3d9ca6cf434a62439e39da (diff) | |
parent | 28de31f5200d908551d8372fed7511df80e284fd (diff) | |
download | gitlab-ce-6fdd9008272f268b05aa498a79dc200da52f7bbc.tar.gz |
Merge pull request #7014 from asedge/api_create_tag
Add CreateTagService. Use new service to allow tag creation through API.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/repositories_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb index a902a1542cc..5afb3bddcb7 100644 --- a/spec/requests/api/repositories_spec.rb +++ b/spec/requests/api/repositories_spec.rb @@ -23,6 +23,24 @@ 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: 'master' + + response.status.should == 201 + json_response['name'].should == 'v1.0.0' + 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] } |