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
3b01d23a
Commit
3b01d23a
authored
Dec 11, 2018
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec for group's user search incl. parent group
parent
241f38b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
spec/lib/gitlab/group_search_results_spec.rb
spec/lib/gitlab/group_search_results_spec.rb
+21
-3
No files found.
spec/lib/gitlab/group_search_results_spec.rb
View file @
3b01d23a
...
...
@@ -15,7 +15,9 @@ describe Gitlab::GroupSearchResults do
create
(
:user
,
username:
'gob_2018'
)
expect
(
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)).
to
eq
[
user1
]
result
=
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)
expect
(
result
).
to
eq
[
user1
]
end
it
'returns the user belonging to the subgroup matching the search query'
,
:nested_groups
do
...
...
@@ -25,7 +27,21 @@ describe Gitlab::GroupSearchResults do
create
(
:user
,
username:
'gob_2018'
)
expect
(
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)).
to
eq
[
user1
]
result
=
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)
expect
(
result
).
to
eq
[
user1
]
end
it
'returns the user belonging to the parent group matching the search query'
,
:nested_groups
do
user1
=
create
(
:user
,
username:
'gob_bluth'
)
parent_group
=
create
(
:group
,
children:
[
group
])
create
(
:group_member
,
:developer
,
user:
user1
,
group:
parent_group
)
create
(
:user
,
username:
'gob_2018'
)
result
=
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)
expect
(
result
).
to
eq
[
user1
]
end
it
'does not return the user belonging to the private subgroup'
,
:nested_groups
do
...
...
@@ -35,7 +51,9 @@ describe Gitlab::GroupSearchResults do
create
(
:user
,
username:
'gob_2018'
)
expect
(
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)).
to
eq
[]
result
=
described_class
.
new
(
user
,
anything
,
group
,
'gob'
).
objects
(
'users'
)
expect
(
result
).
to
eq
[]
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