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
Léo-Paul Géneau
gitlab-ce
Commits
a58e2f47
Commit
a58e2f47
authored
Nov 15, 2016
by
Francesco Coda Zabetta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use Enumerable#find insted of select + first
parent
8fc771ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+3
-3
No files found.
spec/requests/api/labels_spec.rb
View file @
a58e2f47
...
...
@@ -33,9 +33,9 @@ describe API::API, api: true do
expect
(
json_response
.
first
.
keys
).
to
match_array
expected_keys
expect
(
json_response
.
map
{
|
l
|
l
[
'name'
]
}).
to
match_array
([
group_label
.
name
,
priority_label
.
name
,
label1
.
name
])
label1_response
=
json_response
.
select
{
|
l
|
l
[
'name'
]
==
label1
.
title
}.
first
group_label_response
=
json_response
.
select
{
|
l
|
l
[
'name'
]
==
group_label
.
title
}.
first
priority_label_response
=
json_response
.
select
{
|
l
|
l
[
'name'
]
==
priority_label
.
title
}.
first
label1_response
=
json_response
.
find
{
|
l
|
l
[
'name'
]
==
label1
.
title
}
group_label_response
=
json_response
.
find
{
|
l
|
l
[
'name'
]
==
group_label
.
title
}
priority_label_response
=
json_response
.
find
{
|
l
|
l
[
'name'
]
==
priority_label
.
title
}
expect
(
label1_response
[
'open_issues_count'
]).
to
eq
(
0
)
expect
(
label1_response
[
'closed_issues_count'
]).
to
eq
(
1
)
...
...
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