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
62b45829
Commit
62b45829
authored
Oct 12, 2019
by
Patrick Derichs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for filtering by multiple authors
parent
f5bf17c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
spec/finders/todos_finder_spec.rb
spec/finders/todos_finder_spec.rb
+22
-0
No files found.
spec/finders/todos_finder_spec.rb
View file @
62b45829
...
@@ -73,6 +73,28 @@ describe TodosFinder do
...
@@ -73,6 +73,28 @@ describe TodosFinder do
end
end
end
end
context
'when filtering by author'
do
let
(
:author1
)
{
create
(
:user
)
}
let
(
:author2
)
{
create
(
:user
)
}
let!
(
:todo1
)
{
create
(
:todo
,
user:
user
,
author:
author1
)
}
let!
(
:todo2
)
{
create
(
:todo
,
user:
user
,
author:
author2
)
}
it
'returns correct todos when filtering by an author'
do
todos
=
finder
.
new
(
user
,
{
author_id:
author1
.
id
}).
execute
expect
(
todos
).
to
match_array
([
todo1
])
end
context
'querying for multiple authors'
do
it
'returns the correct todo items'
do
todos
=
finder
.
new
(
user
,
{
author_id:
[
author2
.
id
,
author1
.
id
]
}).
execute
expect
(
todos
).
to
match_array
([
todo2
,
todo1
])
end
end
end
context
'with subgroups'
do
context
'with subgroups'
do
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let!
(
:todo3
)
{
create
(
:todo
,
user:
user
,
group:
subgroup
,
target:
issue
)
}
let!
(
:todo3
)
{
create
(
:todo
,
user:
user
,
group:
subgroup
,
target:
issue
)
}
...
...
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