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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
127b4557
Commit
127b4557
authored
Sep 19, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec/ee/spec/controllers/autocomplete_controller_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
07f37e01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
app/finders/autocomplete_users_finder.rb
app/finders/autocomplete_users_finder.rb
+1
-3
spec/ee/spec/controllers/autocomplete_controller_spec.rb
spec/ee/spec/controllers/autocomplete_controller_spec.rb
+4
-4
No files found.
app/finders/autocomplete_users_finder.rb
View file @
127b4557
...
...
@@ -32,9 +32,7 @@ class AutocompleteUsersFinder
items
=
items
.
where
.
not
(
id:
skip_users
)
if
skip_users
.
present?
# EE
items_by_push_ability
=
load_users_by_push_ability
(
items
)
items
=
items
.
page
(
page
).
per
(
per_page
)
unless
items_by_push_ability
# EE
items
=
load_users_by_push_ability
(
items
)
||
items
.
page
(
page
).
per
(
per_page
)
if
params
[
:todo_filter
].
present?
&&
current_user
items
=
items
.
todo_authors
(
current_user
.
id
,
params
[
:todo_state_filter
])
...
...
spec/ee/spec/controllers/autocomplete_controller_spec.rb
View file @
127b4557
...
...
@@ -19,7 +19,7 @@ describe AutocompleteController do
get
(
:users
,
project_id:
project
.
id
,
push_code_to_protected_branches:
'true'
)
end
it
'returns authorized users'
do
it
'returns authorized users'
,
:aggregate_failures
do
expect
(
json_response
).
to
be_kind_of
(
Array
)
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
map
{
|
u
|
u
[
"username"
]
}).
to
match_array
([
user
.
username
])
...
...
@@ -34,7 +34,7 @@ describe AutocompleteController do
get
(
:users
,
project_id:
project
.
id
,
push_code:
'true'
)
end
it
'returns authorized users'
do
it
'returns authorized users'
,
:aggregate_failures
do
expect
(
json_response
).
to
be_kind_of
(
Array
)
expect
(
json_response
.
size
).
to
eq
(
2
)
expect
(
json_response
.
map
{
|
user
|
user
[
"username"
]
}).
to
match_array
([
user
.
username
,
user2
.
username
])
...
...
@@ -46,7 +46,7 @@ describe AutocompleteController do
get
(
:users
,
project_id:
project
.
id
,
push_code_to_protected_branches:
true
,
current_user:
true
)
end
it
'returns authorized users'
do
it
'returns authorized users'
,
:aggregate_failures
do
expect
(
json_response
).
to
be_kind_of
(
Array
)
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
map
{
|
u
|
u
[
"username"
]
}).
to
match_array
([
user
.
username
])
...
...
@@ -70,7 +70,7 @@ describe AutocompleteController do
get
(
:project_groups
,
project_id:
project
.
id
)
end
it
'returns a single group'
do
it
'returns a single group'
,
:aggregate_failures
do
expect
(
json_response
).
to
be_kind_of
(
Array
)
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
first
.
values_at
(
'id'
,
'name'
)).
to
eq
[
matching_group
.
id
,
matching_group
.
name
]
...
...
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