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
3ae0a8bf
Commit
3ae0a8bf
authored
Apr 07, 2021
by
Mario Celi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not return empty issues if negated assignee does not exist
parent
e5845760
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+0
-2
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+18
-0
No files found.
app/finders/issuable_finder.rb
View file @
3ae0a8bf
...
...
@@ -395,8 +395,6 @@ class IssuableFinder
# We want CE users to be able to say "Issues not assigned to either PersonA nor PersonB"
if
not_params
.
assignees
.
present?
items
.
not_assigned_to
(
not_params
.
assignees
)
elsif
not_params
.
assignee_id?
||
not_params
.
assignee_username?
# assignee not found
items
.
none
else
items
end
...
...
spec/finders/issues_finder_spec.rb
View file @
3ae0a8bf
...
...
@@ -49,6 +49,13 @@ RSpec.describe IssuesFinder do
let
(
:expected_issuables
)
{
[
issue3
,
issue4
]
}
end
context
'when assignee_id does not exist'
do
it_behaves_like
'assignee NOT ID filter'
do
let
(
:params
)
{
{
not:
{
assignee_id:
-
100
}
}
}
let
(
:expected_issuables
)
{
[
issue1
,
issue2
,
issue3
,
issue4
,
issue5
]
}
end
end
context
'filter by username'
do
let_it_be
(
:user3
)
{
create
(
:user
)
}
...
...
@@ -76,6 +83,17 @@ RSpec.describe IssuesFinder do
let
(
:params
)
{
{
not:
{
assignee_username:
[
user
.
username
,
user2
.
username
]
}
}
}
let
(
:expected_issuables
)
{
[
issue3
,
issue4
]
}
end
context
'when assignee_username does not exist'
do
it_behaves_like
'assignee NOT username filter'
do
before
do
issue2
.
assignees
=
[
user2
]
end
let
(
:params
)
{
{
not:
{
assignee_username:
'non_existent_username'
}
}
}
let
(
:expected_issuables
)
{
[
issue1
,
issue2
,
issue3
,
issue4
,
issue5
]
}
end
end
end
it_behaves_like
'no assignee filter'
do
...
...
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