summaryrefslogtreecommitdiff
path: root/spec/requests/api/tags_spec.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-04-06 13:59:50 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-04-12 12:38:59 +0200
commit20d4ca4cc3599b4335b73fd7c3bb0354efe397b4 (patch)
treed14e5572bfe5f64e891db0493e4b3814cbd3467c /spec/requests/api/tags_spec.rb
parent8cb41f19891e4f39c64abd6b2a273625103c5f43 (diff)
downloadgitlab-ce-20d4ca4cc3599b4335b73fd7c3bb0354efe397b4.tar.gz
API: Ability to retrieve a single tag
Diffstat (limited to 'spec/requests/api/tags_spec.rb')
-rw-r--r--spec/requests/api/tags_spec.rb17
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