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
Tatuya Kamada
gitlab-ce
Commits
9b288238
Commit
9b288238
authored
Oct 13, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List all available labels to the project on the labels API
parent
68f30b2f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
lib/api/labels.rb
lib/api/labels.rb
+1
-1
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+9
-3
No files found.
lib/api/labels.rb
View file @
9b288238
...
...
@@ -11,7 +11,7 @@ module API
# Example Request:
# GET /projects/:id/labels
get
':id/labels'
do
present
user_project
.
labels
,
with:
Entities
::
Label
,
current_user:
current_user
present
available_
labels
,
with:
Entities
::
Label
,
current_user:
current_user
end
# Creates a new label
...
...
spec/requests/api/labels_spec.rb
View file @
9b288238
...
...
@@ -12,12 +12,18 @@ describe API::API, api: true do
end
describe
'GET /projects/:id/labels'
do
it
'returns project labels'
do
it
'returns all available labels to the project'
do
group
=
create
(
:group
)
group_label
=
create
(
:group_label
,
group:
group
)
project
.
update
(
group:
group
)
get
api
(
"/projects/
#{
project
.
id
}
/labels"
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'name'
]).
to
eq
(
label1
.
name
)
expect
(
json_response
.
size
).
to
eq
(
2
)
expect
(
json_response
.
first
[
'name'
]).
to
eq
(
group_label
.
name
)
expect
(
json_response
.
second
[
'name'
]).
to
eq
(
label1
.
name
)
end
end
...
...
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