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
Jérome Perrin
gitlab-ce
Commits
d38322b8
Commit
d38322b8
authored
Feb 17, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change `.map{...}.inject{...}` to `any?{...}` for searching shared runners
parent
957c4de9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+5
-5
No files found.
spec/requests/api/runners_spec.rb
View file @
d38322b8
...
@@ -37,7 +37,7 @@ describe API::API, api: true do
...
@@ -37,7 +37,7 @@ describe API::API, api: true do
context
'authorized user'
do
context
'authorized user'
do
it
'should return user available runners'
do
it
'should return user available runners'
do
get
api
(
'/runners'
,
user
)
get
api
(
'/runners'
,
user
)
shared
=
json_response
.
map
{
|
r
|
r
[
'is_shared'
]
}.
inject
{
|
sum
,
shr
|
sum
||
shr
}
shared
=
json_response
.
any?
{
|
r
|
r
[
'is_shared'
]
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
...
@@ -46,7 +46,7 @@ describe API::API, api: true do
...
@@ -46,7 +46,7 @@ describe API::API, api: true do
it
'should filter runners by scope'
do
it
'should filter runners by scope'
do
get
api
(
'/runners?scope=active'
,
user
)
get
api
(
'/runners?scope=active'
,
user
)
shared
=
json_response
.
map
{
|
r
|
r
[
'is_shared'
]
}.
inject
{
|
sum
,
shr
|
sum
||
shr
}
shared
=
json_response
.
any?
{
|
r
|
r
[
'is_shared'
]
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
...
@@ -73,7 +73,7 @@ describe API::API, api: true do
...
@@ -73,7 +73,7 @@ describe API::API, api: true do
context
'with admin privileges'
do
context
'with admin privileges'
do
it
'should return all runners'
do
it
'should return all runners'
do
get
api
(
'/runners/all'
,
admin
)
get
api
(
'/runners/all'
,
admin
)
shared
=
json_response
.
map
{
|
r
|
r
[
'is_shared'
]
}.
inject
{
|
sum
,
shr
|
sum
||
shr
}
shared
=
json_response
.
any?
{
|
r
|
r
[
'is_shared'
]
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
...
@@ -91,7 +91,7 @@ describe API::API, api: true do
...
@@ -91,7 +91,7 @@ describe API::API, api: true do
it
'should filter runners by scope'
do
it
'should filter runners by scope'
do
get
api
(
'/runners/all?scope=specific'
,
admin
)
get
api
(
'/runners/all?scope=specific'
,
admin
)
shared
=
json_response
.
map
{
|
r
|
r
[
'is_shared'
]
}.
inject
{
|
sum
,
shr
|
sum
||
shr
}
shared
=
json_response
.
any?
{
|
r
|
r
[
'is_shared'
]
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
...
@@ -326,7 +326,7 @@ describe API::API, api: true do
...
@@ -326,7 +326,7 @@ describe API::API, api: true do
context
'authorized user with master privileges'
do
context
'authorized user with master privileges'
do
it
"should return project's runners"
do
it
"should return project's runners"
do
get
api
(
"/projects/
#{
project
.
id
}
/runners"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/runners"
,
user
)
shared
=
json_response
.
map
{
|
r
|
r
[
'is_shared'
]
}.
inject
{
|
sum
,
shr
|
sum
||
shr
}
shared
=
json_response
.
any?
{
|
r
|
r
[
'is_shared'
]
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
...
...
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