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
385524c3
Commit
385524c3
authored
Oct 27, 2018
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests
parent
4f53ab13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
4 deletions
+46
-4
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
+16
-0
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+16
-0
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+14
-4
No files found.
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
View file @
385524c3
...
...
@@ -121,6 +121,22 @@ describe 'Dropdown emoji', :js do
send_keys_to_filtered_search
(
':'
)
end
it
'selects `None`'
do
find
(
'#js-dropdown-assignee .filter-dropdown-item'
,
text:
'None'
).
click
expect
(
page
).
to
have_css
(
js_dropdown_emoji
,
visible:
false
)
expect_tokens
([
emoji_token
(
'none'
)])
expect_filtered_search_input_empty
end
it
'selects `Any`'
do
find
(
'#js-dropdown-assignee .filter-dropdown-item'
,
text:
'Any'
).
click
expect
(
page
).
to
have_css
(
js_dropdown_emoji
,
visible:
false
)
expect_tokens
([
emoji_token
(
'any'
)])
expect_filtered_search_input_empty
end
it
'fills in the my-reaction name'
do
click_emoji
(
'thumbsup'
)
...
...
spec/finders/issues_finder_spec.rb
View file @
385524c3
...
...
@@ -360,6 +360,22 @@ describe IssuesFinder do
end
context
'filtering by reaction name'
do
context
'user searches by no reaction'
do
let
(
:params
)
{
{
my_reaction_emoji:
'None'
}
}
it
'returns issues that the user did not react to'
do
expect
(
issues
).
to
contain_exactly
(
issue2
,
issue4
)
end
end
context
'user searches by any reaction'
do
let
(
:params
)
{
{
my_reaction_emoji:
'Any'
}
}
it
'returns issues that the user reacted to'
do
expect
(
issues
).
to
contain_exactly
(
issue1
,
issue3
)
end
end
context
'user searches by "thumbsup" reaction'
do
let
(
:params
)
{
{
my_reaction_emoji:
'thumbsup'
}
}
...
...
spec/requests/api/issues_spec.rb
View file @
385524c3
...
...
@@ -196,14 +196,24 @@ describe API::Issues do
expect_paginated_array_response
(
size:
3
)
end
it
'returns issues reacted by the authenticated user
by the given emoji
'
do
it
'returns issues reacted by the authenticated user'
do
issue2
=
create
(
:issue
,
project:
project
,
author:
user
,
assignees:
[
user
])
award_emoji
=
create
(
:award_emoji
,
awardable:
issue2
,
user:
user2
,
name:
'star'
)
get
api
(
'/issues'
,
user2
),
my_reaction_emoji:
award_emoji
.
name
,
scope:
'all'
create
(
:award_emoji
,
awardable:
issue
,
user:
user2
,
name:
'thumbsup'
)
expect_paginated_array_response
(
size:
1
)
expect
(
first_issue
[
'id'
]).
to
eq
(
issue2
.
id
)
get
api
(
'/issues'
,
user2
),
my_reaction_emoji:
'Any'
,
scope:
'all'
expect_paginated_array_response
(
size:
2
)
end
it
'returns issues not reacted by the authenticated user'
do
issue2
=
create
(
:issue
,
project:
project
,
author:
user
,
assignees:
[
user
])
create
(
:award_emoji
,
awardable:
issue2
,
user:
user2
,
name:
'star'
)
get
api
(
'/issues'
,
user2
),
my_reaction_emoji:
'None'
,
scope:
'all'
expect_paginated_array_response
(
size:
2
)
end
it
'returns issues matching given search string for title'
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