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
Boxiang Sun
gitlab-ce
Commits
cc8b8ec0
Commit
cc8b8ec0
authored
Feb 13, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs and specs
parent
1809f6f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
doc/api/labels.md
doc/api/labels.md
+16
-8
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+4
-1
No files found.
doc/api/labels.md
View file @
cc8b8ec0
...
@@ -29,7 +29,8 @@ Example response:
...
@@ -29,7 +29,8 @@ Example response:
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"open_merge_requests_count"
:
1
,
"open_merge_requests_count"
:
1
,
"subscribed"
:
false
,
"subscribed"
:
false
,
"priority"
:
10
"priority"
:
10
,
"is_project_label"
:
true
},
},
{
{
"id"
:
4
,
"id"
:
4
,
...
@@ -40,7 +41,8 @@ Example response:
...
@@ -40,7 +41,8 @@ Example response:
"closed_issues_count"
:
5
,
"closed_issues_count"
:
5
,
"open_merge_requests_count"
:
0
,
"open_merge_requests_count"
:
0
,
"subscribed"
:
false
,
"subscribed"
:
false
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
true
},
},
{
{
"id"
:
7
,
"id"
:
7
,
...
@@ -51,7 +53,8 @@ Example response:
...
@@ -51,7 +53,8 @@ Example response:
"closed_issues_count"
:
3
,
"closed_issues_count"
:
3
,
"open_merge_requests_count"
:
1
,
"open_merge_requests_count"
:
1
,
"subscribed"
:
false
,
"subscribed"
:
false
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
true
},
},
{
{
"id"
:
8
,
"id"
:
8
,
...
@@ -62,7 +65,8 @@ Example response:
...
@@ -62,7 +65,8 @@ Example response:
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"open_merge_requests_count"
:
2
,
"open_merge_requests_count"
:
2
,
"subscribed"
:
false
,
"subscribed"
:
false
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
false
},
},
{
{
"id"
:
9
,
"id"
:
9
,
...
@@ -73,7 +77,8 @@ Example response:
...
@@ -73,7 +77,8 @@ Example response:
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"open_merge_requests_count"
:
1
,
"open_merge_requests_count"
:
1
,
"subscribed"
:
true
,
"subscribed"
:
true
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
true
}
}
]
]
```
```
...
@@ -110,7 +115,8 @@ Example response:
...
@@ -110,7 +115,8 @@ Example response:
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"open_merge_requests_count"
:
0
,
"open_merge_requests_count"
:
0
,
"subscribed"
:
false
,
"subscribed"
:
false
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
true
}
}
```
```
...
@@ -166,7 +172,8 @@ Example response:
...
@@ -166,7 +172,8 @@ Example response:
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"open_merge_requests_count"
:
2
,
"open_merge_requests_count"
:
2
,
"subscribed"
:
false
,
"subscribed"
:
false
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
true
}
}
```
```
...
@@ -201,7 +208,8 @@ Example response:
...
@@ -201,7 +208,8 @@ Example response:
"closed_issues_count"
:
0
,
"closed_issues_count"
:
0
,
"open_merge_requests_count"
:
1
,
"open_merge_requests_count"
:
1
,
"subscribed"
:
true
,
"subscribed"
:
true
,
"priority"
:
null
"priority"
:
null
,
"is_project_label"
:
true
}
}
```
```
...
...
spec/requests/api/labels_spec.rb
View file @
cc8b8ec0
...
@@ -22,7 +22,7 @@ describe API::Labels do
...
@@ -22,7 +22,7 @@ describe API::Labels do
expected_keys
=
%w(
expected_keys
=
%w(
id name color description
id name color description
open_issues_count closed_issues_count open_merge_requests_count
open_issues_count closed_issues_count open_merge_requests_count
subscribed priority
subscribed priority
is_project_label
)
)
get
api
(
"/projects/
#{
project
.
id
}
/labels"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/labels"
,
user
)
...
@@ -46,6 +46,7 @@ describe API::Labels do
...
@@ -46,6 +46,7 @@ describe API::Labels do
expect
(
label1_response
[
'description'
]).
to
be_nil
expect
(
label1_response
[
'description'
]).
to
be_nil
expect
(
label1_response
[
'priority'
]).
to
be_nil
expect
(
label1_response
[
'priority'
]).
to
be_nil
expect
(
label1_response
[
'subscribed'
]).
to
be_falsey
expect
(
label1_response
[
'subscribed'
]).
to
be_falsey
expect
(
label1_response
[
'is_project_label'
]).
to
be_truthy
expect
(
group_label_response
[
'open_issues_count'
]).
to
eq
(
1
)
expect
(
group_label_response
[
'open_issues_count'
]).
to
eq
(
1
)
expect
(
group_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
expect
(
group_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
...
@@ -55,6 +56,7 @@ describe API::Labels do
...
@@ -55,6 +56,7 @@ describe API::Labels do
expect
(
group_label_response
[
'description'
]).
to
be_nil
expect
(
group_label_response
[
'description'
]).
to
be_nil
expect
(
group_label_response
[
'priority'
]).
to
be_nil
expect
(
group_label_response
[
'priority'
]).
to
be_nil
expect
(
group_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
group_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
group_label_response
[
'is_project_label'
]).
to
be_falsey
expect
(
priority_label_response
[
'open_issues_count'
]).
to
eq
(
0
)
expect
(
priority_label_response
[
'open_issues_count'
]).
to
eq
(
0
)
expect
(
priority_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
expect
(
priority_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
...
@@ -64,6 +66,7 @@ describe API::Labels do
...
@@ -64,6 +66,7 @@ describe API::Labels do
expect
(
priority_label_response
[
'description'
]).
to
be_nil
expect
(
priority_label_response
[
'description'
]).
to
be_nil
expect
(
priority_label_response
[
'priority'
]).
to
eq
(
3
)
expect
(
priority_label_response
[
'priority'
]).
to
eq
(
3
)
expect
(
priority_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
priority_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
priority_label_response
[
'is_project_label'
]).
to
be_truthy
end
end
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