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
e4029070
Commit
e4029070
authored
Jan 28, 2017
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter todos by manual add
Added the option to filter todo by Added and Pipelines
parent
b78d06b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
8 deletions
+61
-8
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+3
-1
changelogs/unreleased/26705-filter-todos-by-manual-add.yml
changelogs/unreleased/26705-filter-todos-by-manual-add.yml
+4
-0
spec/factories/todos.rb
spec/factories/todos.rb
+4
-0
spec/features/todos/todos_filtering_spec.rb
spec/features/todos/todos_filtering_spec.rb
+50
-7
No files found.
app/helpers/todos_helper.rb
View file @
e4029070
...
...
@@ -86,7 +86,9 @@ module TodosHelper
[
{
id:
''
,
text:
'Any Action'
},
{
id:
Todo
::
ASSIGNED
,
text:
'Assigned'
},
{
id:
Todo
::
MENTIONED
,
text:
'Mentioned'
}
{
id:
Todo
::
MENTIONED
,
text:
'Mentioned'
},
{
id:
Todo
::
MARKED
,
text:
'Added'
},
{
id:
Todo
::
BUILD_FAILED
,
text:
'Pipelines'
}
]
end
...
...
changelogs/unreleased/26705-filter-todos-by-manual-add.yml
0 → 100644
View file @
e4029070
---
title
:
Filter todos by manual add
merge_request
:
8691
author
:
Jacopo Beschi @jacopo-beschi
spec/factories/todos.rb
View file @
e4029070
...
...
@@ -24,6 +24,10 @@ FactoryGirl.define do
target
factory: :merge_request
end
trait
:marked
do
action
{
Todo
::
MARKED
}
end
trait
:approval_required
do
action
{
Todo
::
APPROVAL_REQUIRED
}
end
...
...
spec/features/todos/todos_filtering_spec.rb
View file @
e4029070
...
...
@@ -98,15 +98,58 @@ describe 'Dashboard > User filters todos', feature: true, js: true do
expect
(
find
(
'.todos-list'
)).
not_to
have_content
merge_request
.
to_reference
end
it
'filters
by action'
do
click_button
'Action'
within
'.dropdown-menu-action'
do
c
lick_link
'Assigned'
describe
'filter
by action'
do
before
do
create
(
:todo
,
:build_failed
,
user:
user_1
,
author:
user_2
,
project:
project_1
)
c
reate
(
:todo
,
:marked
,
user:
user_1
,
author:
user_2
,
project:
project_1
,
target:
issue
)
end
wait_for_ajax
it
'filters by Assigned'
do
filter_action
(
'Assigned'
)
expect_to_see_action
(
:assigned
)
end
it
'filters by Mentioned'
do
filter_action
(
'Mentioned'
)
expect_to_see_action
(
:mentioned
)
end
it
'filters by Added'
do
filter_action
(
'Added'
)
expect_to_see_action
(
:marked
)
end
it
'filters by Pipelines'
do
filter_action
(
'Pipelines'
)
expect
(
find
(
'.todos-list'
)).
to
have_content
' assigned you '
expect
(
find
(
'.todos-list'
)).
not_to
have_content
' mentioned '
expect_to_see_action
(
:build_failed
)
end
def
filter_action
(
name
)
click_button
'Action'
within
'.dropdown-menu-action'
do
click_link
name
end
wait_for_ajax
end
def
expect_to_see_action
(
action_name
)
action_names
=
{
assigned:
' assigned you '
,
mentioned:
' mentioned '
,
marked:
' added a todo for '
,
build_failed:
' build failed for '
}
action_name_text
=
action_names
.
delete
(
action_name
)
expect
(
find
(
'.todos-list'
)).
to
have_content
action_name_text
action_names
.
each_value
do
|
other_action_text
|
expect
(
find
(
'.todos-list'
)).
not_to
have_content
other_action_text
end
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