diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-06 13:59:50 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-06 13:59:50 +0200 |
commit | 7f287c9136d5d1cdda8df170c6e772ca82aad1e9 (patch) | |
tree | 789766ad1b383310fc74b055e6869f1f1698f7bf /spec/requests | |
parent | f76bfed9fc3e52c7b3b731dbb311b6b394d9af62 (diff) | |
download | gitlab-ce-7f287c9136d5d1cdda8df170c6e772ca82aad1e9.tar.gz |
API: Ability to retrieve a single tag
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/tags_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb index a15be07ed57..acbd9c3e332 100644 --- a/spec/requests/api/tags_spec.rb +++ b/spec/requests/api/tags_spec.rb @@ -40,6 +40,23 @@ describe API::API, api: true do end end + describe "GET /projects/:id/repository/tags/:tag_name" do + let(:tag_name) { project.repository.tag_names.sort.reverse.first } + + it 'should return a specific tag' do + get api("/projects/#{project.id}/repository/tags/#{tag_name}", user) + + expect(response.status).to eq(200) + expect(json_response['name']).to eq(tag_name) + end + + it 'should return 404 for an invalid tag name' do + get api("/projects/#{project.id}/repository/tags/foobar", user) + + expect(response.status).to eq(404) + end + end + describe 'POST /projects/:id/repository/tags' do context 'lightweight tags' do it 'should create a new tag' do |