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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
16caf95c
Commit
16caf95c
authored
Nov 13, 2017
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix filter by my reaction is not working
parent
a978e9b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-0
changelogs/unreleased/fix-filter-by-my-reaction.yml
changelogs/unreleased/fix-filter-by-my-reaction.yml
+5
-0
spec/controllers/concerns/issuable_collections_spec.rb
spec/controllers/concerns/issuable_collections_spec.rb
+54
-1
No files found.
app/finders/issuable_finder.rb
View file @
16caf95c
...
...
@@ -36,6 +36,7 @@ class IssuableFinder
iids
label_name
milestone_title
my_reaction_emoji
non_archived
project_id
scope
...
...
changelogs/unreleased/fix-filter-by-my-reaction.yml
0 → 100644
View file @
16caf95c
---
title
:
Fix filter by my reaction is not working
merge_request
:
15345
author
:
Hiroyuki Sato
type
:
fixed
spec/controllers/concerns/issuable_collections_spec.rb
View file @
16caf95c
...
...
@@ -12,12 +12,14 @@ describe IssuableCollections do
controller
=
klass
.
new
allow
(
controller
).
to
receive
(
:params
).
and_return
(
state:
'opened'
)
allow
(
controller
).
to
receive
(
:params
).
and_return
(
ActionController
::
Parameters
.
new
(
params
)
)
controller
end
describe
'#page_count_for_relation'
do
let
(
:params
)
{
{
state:
'opened'
}
}
it
'returns the number of pages'
do
relation
=
double
(
:relation
,
limit_value:
20
)
pages
=
controller
.
send
(
:page_count_for_relation
,
relation
,
28
)
...
...
@@ -25,4 +27,55 @@ describe IssuableCollections do
expect
(
pages
).
to
eq
(
2
)
end
end
describe
'#filter_params'
do
let
(
:params
)
do
{
assignee_id:
'1'
,
assignee_username:
'user1'
,
author_id:
'2'
,
author_username:
'user2'
,
authorized_only:
'true'
,
due_date:
'2017-01-01'
,
group_id:
'3'
,
iids:
'4'
,
label_name:
'foo'
,
milestone_title:
'bar'
,
my_reaction_emoji:
'thumbsup'
,
non_archived:
'true'
,
project_id:
'5'
,
scope:
'all'
,
search:
'baz'
,
sort:
'priority'
,
state:
'opened'
,
invalid_param:
'invalid_param'
}
end
it
'filters params'
do
allow
(
controller
).
to
receive
(
:cookies
).
and_return
({})
filtered_params
=
controller
.
send
(
:filter_params
)
expect
(
filtered_params
).
to
eq
({
'assignee_id'
=>
'1'
,
'assignee_username'
=>
'user1'
,
'author_id'
=>
'2'
,
'author_username'
=>
'user2'
,
'authorized_only'
=>
'true'
,
'due_date'
=>
'2017-01-01'
,
'group_id'
=>
'3'
,
'iids'
=>
'4'
,
'label_name'
=>
'foo'
,
'milestone_title'
=>
'bar'
,
'my_reaction_emoji'
=>
'thumbsup'
,
'non_archived'
=>
'true'
,
'project_id'
=>
'5'
,
'scope'
=>
'all'
,
'search'
=>
'baz'
,
'sort'
=>
'priority'
,
'state'
=>
'opened'
})
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