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
993fe2ab
Commit
993fe2ab
authored
Oct 13, 2019
by
Patrick Derichs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for multiple type query
parent
3793d78a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
spec/finders/todos_finder_spec.rb
spec/finders/todos_finder_spec.rb
+17
-13
No files found.
spec/finders/todos_finder_spec.rb
View file @
993fe2ab
...
...
@@ -36,10 +36,18 @@ describe TodosFinder do
expect
(
todos
).
to
match_array
([
todo1
,
todo2
])
end
it
'returns correct todos when filtered by a type'
do
todos
=
finder
.
new
(
user
,
{
type:
'Issue'
}).
execute
context
'when filtering by type'
do
it
'returns correct todos when filtered by a type'
do
todos
=
finder
.
new
(
user
,
{
type:
'Issue'
}).
execute
expect
(
todos
).
to
match_array
([
todo1
])
expect
(
todos
).
to
match_array
([
todo1
])
end
it
'returns the correct todos when filtering for multiple types'
do
todos
=
finder
.
new
(
user
,
{
type:
%w[Issue MergeRequest]
}).
execute
expect
(
todos
).
to
match_array
([
todo1
,
todo2
])
end
end
context
'when filtering for actions'
do
...
...
@@ -53,12 +61,10 @@ describe TodosFinder do
expect
(
todos
).
to
match_array
([
todo2
])
end
context
'multiple actions'
do
it
'returns the expected todos'
do
todos
=
finder
.
new
(
user
,
{
action_id:
[
Todo
::
DIRECTLY_ADDRESSED
,
Todo
::
ASSIGNED
]
}).
execute
it
'returns the expected todos when filtering for multiple action ids'
do
todos
=
finder
.
new
(
user
,
{
action_id:
[
Todo
::
DIRECTLY_ADDRESSED
,
Todo
::
ASSIGNED
]
}).
execute
expect
(
todos
).
to
match_array
([
todo2
,
todo1
])
end
expect
(
todos
).
to
match_array
([
todo2
,
todo1
])
end
end
...
...
@@ -69,12 +75,10 @@ describe TodosFinder do
expect
(
todos
).
to
match_array
([
todo2
])
end
context
'multiple actions'
do
it
'returns the expected todos'
do
todos
=
finder
.
new
(
user
,
{
action:
[
:directly_addressed
,
:assigned
]
}).
execute
it
'returns the expected todos when filtering for multiple action names'
do
todos
=
finder
.
new
(
user
,
{
action:
[
:directly_addressed
,
:assigned
]
}).
execute
expect
(
todos
).
to
match_array
([
todo2
,
todo1
])
end
expect
(
todos
).
to
match_array
([
todo2
,
todo1
])
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