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
8966c6e3
Commit
8966c6e3
authored
Nov 15, 2016
by
Francesco Coda Zabetta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
a58e2f47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+21
-6
No files found.
spec/requests/api/labels_spec.rb
View file @
8966c6e3
...
...
@@ -19,6 +19,8 @@ describe API::API, api: true do
project
.
update
(
group:
group
)
create
(
:labeled_issue
,
project:
project
,
labels:
[
group_label
],
author:
user
)
create
(
:labeled_issue
,
project:
project
,
labels:
[
label1
],
author:
user
,
state: :closed
)
create
(
:labeled_merge_request
,
labels:
[
priority_label
],
author:
user
,
source_project:
project
)
expected_keys
=
[
'id'
,
'name'
,
'color'
,
'description'
,
'open_issues_count'
,
'closed_issues_count'
,
'open_merge_requests_count'
,
...
...
@@ -39,17 +41,30 @@ describe API::API, api: true do
expect
(
label1_response
[
'open_issues_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'closed_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
(
priority_label_response
[
'open_issues_count'
]).
to
eq
(
0
)
expect
(
priority_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'name'
]).
to
eq
(
label1
.
name
)
expect
(
label1_response
[
'color'
]).
to
be_present
expect
(
label1_response
[
'description'
]).
to
be_nil
expect
(
label1_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'priority'
]).
to
be_nil
expect
(
label1_response
[
'subscribed'
]).
to
be_falsey
expect
(
group_label_response
[
'open_issues_count'
]).
to
eq
(
1
)
expect
(
group_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
expect
(
group_label_response
[
'open_merge_requests_count'
]).
to
eq
(
0
)
expect
(
group_label_response
[
'name'
]).
to
eq
(
group_label
.
name
)
expect
(
group_label_response
[
'color'
]).
to
be_present
expect
(
group_label_response
[
'description'
]).
to
be_nil
expect
(
group_label_response
[
'priority'
]).
to
be_nil
expect
(
group_label_response
[
'subscribed'
]).
to
be_falsey
expect
(
priority_label_response
[
'open_issues_count'
]).
to
eq
(
0
)
expect
(
priority_label_response
[
'closed_issues_count'
]).
to
eq
(
0
)
expect
(
priority_label_response
[
'open_merge_requests_count'
]).
to
eq
(
1
)
expect
(
priority_label_response
[
'name'
]).
to
eq
(
priority_label
.
name
)
expect
(
priority_label_response
[
'color'
]).
to
be_present
expect
(
priority_label_response
[
'description'
]).
to
be_nil
expect
(
priority_label_response
[
'priority'
]).
to
eq
(
3
)
expect
(
priority_label_response
[
'subscribed'
]).
to
be_falsey
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