Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
f81352f5
Commit
f81352f5
authored
Apr 12, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix minor styling issues from code review
parent
20d4ca4c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
doc/api/tags.md
doc/api/tags.md
+2
-2
lib/api/tags.rb
lib/api/tags.rb
+3
-3
spec/requests/api/tags_spec.rb
spec/requests/api/tags_spec.rb
+3
-3
No files found.
doc/api/tags.md
View file @
f81352f5
...
@@ -40,8 +40,8 @@ Parameters:
...
@@ -40,8 +40,8 @@ Parameters:
## Get a single repository tag
## Get a single repository tag
Get a specific repository tag determined by its name. It returns
200
together
Get a specific repository tag determined by its name. It returns
`200`
together
with the tag information if the tag exists. It returns
404
if the tag does not
with the tag information if the tag exists. It returns
`404`
if the tag does not
exist.
exist.
```
```
...
...
lib/api/tags.rb
View file @
f81352f5
...
@@ -23,7 +23,7 @@ module API
...
@@ -23,7 +23,7 @@ module API
# tag_name (required) - The name of the tag
# tag_name (required) - The name of the tag
# Example Request:
# Example Request:
# GET /projects/:id/repository/tags/:tag_name
# GET /projects/:id/repository/tags/:tag_name
get
":id/repository/tags/:tag_name"
,
requirements:
{
tag_name:
/.
*
/
}
do
get
":id/repository/tags/:tag_name"
,
requirements:
{
tag_name:
/.
+
/
}
do
tag
=
user_project
.
repository
.
find_tag
(
params
[
:tag_name
])
tag
=
user_project
.
repository
.
find_tag
(
params
[
:tag_name
])
not_found!
(
'Tag'
)
unless
tag
not_found!
(
'Tag'
)
unless
tag
...
...
spec/requests/api/tags_spec.rb
View file @
f81352f5
...
@@ -40,17 +40,17 @@ describe API::API, api: true do
...
@@ -40,17 +40,17 @@ describe API::API, api: true do
end
end
end
end
describe
"GET /projects/:id/repository/tags/:tag_name"
do
describe
'GET /projects/:id/repository/tags/:tag_name'
do
let
(
:tag_name
)
{
project
.
repository
.
tag_names
.
sort
.
reverse
.
first
}
let
(
:tag_name
)
{
project
.
repository
.
tag_names
.
sort
.
reverse
.
first
}
it
'
should return
a specific tag'
do
it
'
returns
a specific tag'
do
get
api
(
"/projects/
#{
project
.
id
}
/repository/tags/
#{
tag_name
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/repository/tags/
#{
tag_name
}
"
,
user
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
'name'
]).
to
eq
(
tag_name
)
expect
(
json_response
[
'name'
]).
to
eq
(
tag_name
)
end
end
it
'
should return
404 for an invalid tag name'
do
it
'
returns
404 for an invalid tag name'
do
get
api
(
"/projects/
#{
project
.
id
}
/repository/tags/foobar"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/repository/tags/foobar"
,
user
)
expect
(
response
.
status
).
to
eq
(
404
)
expect
(
response
.
status
).
to
eq
(
404
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment