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
646521bd
Commit
646521bd
authored
Jul 24, 2019
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport ToDo feature specs from EE
This ensures that both CE and EE have the same specs.
parent
998cd8cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
spec/features/dashboard/todos/todos_filtering_spec.rb
spec/features/dashboard/todos/todos_filtering_spec.rb
+35
-7
No files found.
spec/features/dashboard/todos/todos_filtering_spec.rb
View file @
646521bd
...
...
@@ -6,23 +6,36 @@ describe 'Dashboard > User filters todos', :js do
let
(
:user_1
)
{
create
(
:user
,
username:
'user_1'
,
name:
'user_1'
)
}
let
(
:user_2
)
{
create
(
:user
,
username:
'user_2'
,
name:
'user_2'
)
}
let
(
:
project_1
)
{
create
(
:project
,
name:
'project_1'
)
}
let
(
:
project_2
)
{
create
(
:project
,
name:
'project_2'
)
}
let
(
:
group1
)
{
create
(
:group
)
}
let
(
:
group2
)
{
create
(
:group
)
}
let
(
:issue
)
{
create
(
:issue
,
title:
'issue'
,
project:
project_1
)
}
let
(
:project_1
)
{
create
(
:project
,
name:
'project_1'
,
namespace:
group1
)
}
let
(
:project_2
)
{
create
(
:project
,
name:
'project_2'
,
namespace:
group1
)
}
let
(
:project_3
)
{
create
(
:project
,
name:
'project_3'
,
namespace:
group2
)
}
let
(
:issue1
)
{
create
(
:issue
,
title:
'issue'
,
project:
project_1
)
}
let
(
:issue2
)
{
create
(
:issue
,
title:
'issue'
,
project:
project_3
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project_2
,
title:
'merge_request'
)
}
before
do
create
(
:todo
,
user:
user_1
,
author:
user_2
,
project:
project_1
,
target:
issue
,
action:
1
)
create
(
:todo
,
user:
user_1
,
author:
user_2
,
project:
project_1
,
target:
issue1
,
action:
1
)
create
(
:todo
,
user:
user_1
,
author:
user_2
,
project:
project_3
,
target:
issue2
,
action:
1
)
create
(
:todo
,
user:
user_1
,
author:
user_1
,
project:
project_2
,
target:
merge_request
,
action:
2
)
project_1
.
add_developer
(
user_1
)
project_2
.
add_developer
(
user_1
)
project_3
.
add_developer
(
user_1
)
sign_in
(
user_1
)
visit
dashboard_todos_path
end
it
'displays all todos without a filter'
do
expect
(
page
).
to
have_content
issue1
.
to_reference
(
full:
true
)
expect
(
page
).
to
have_content
merge_request
.
to_reference
(
full:
true
)
expect
(
page
).
to
have_content
issue2
.
to_reference
(
full:
true
)
end
it
'filters by project'
do
click_button
'Project'
within
'.dropdown-menu-project'
do
...
...
@@ -36,6 +49,20 @@ describe 'Dashboard > User filters todos', :js do
expect
(
page
).
not_to
have_content
project_2
.
full_name
end
it
'filters by group'
do
click_button
'Group'
within
'.dropdown-menu-group'
do
fill_in
'Search groups'
,
with:
group1
.
full_name
click_link
group1
.
full_name
end
wait_for_requests
expect
(
page
).
to
have_content
issue1
.
to_reference
(
full:
true
)
expect
(
page
).
to
have_content
merge_request
.
to_reference
(
full:
true
)
expect
(
page
).
not_to
have_content
issue2
.
to_reference
(
full:
true
)
end
context
'Author filter'
do
it
'filters by author'
do
click_button
'Author'
...
...
@@ -65,7 +92,7 @@ describe 'Dashboard > User filters todos', :js do
it
'shows only authors of existing done todos'
do
user_3
=
create
:user
user_4
=
create
:user
create
(
:todo
,
user:
user_1
,
author:
user_3
,
project:
project_1
,
target:
issue
,
action:
1
,
state: :done
)
create
(
:todo
,
user:
user_1
,
author:
user_3
,
project:
project_1
,
target:
issue
1
,
action:
1
,
state: :done
)
create
(
:todo
,
user:
user_1
,
author:
user_4
,
project:
project_2
,
target:
merge_request
,
action:
2
,
state: :done
)
project_1
.
add_developer
(
user_3
)
...
...
@@ -94,14 +121,15 @@ describe 'Dashboard > User filters todos', :js do
wait_for_requests
expect
(
find
(
'.todos-list'
)).
to
have_content
issue
.
to_reference
expect
(
find
(
'.todos-list'
)).
to
have_content
issue1
.
to_reference
expect
(
find
(
'.todos-list'
)).
to
have_content
issue2
.
to_reference
expect
(
find
(
'.todos-list'
)).
not_to
have_content
merge_request
.
to_reference
end
describe
'filter by action'
do
before
do
create
(
:todo
,
:build_failed
,
user:
user_1
,
author:
user_2
,
project:
project_1
)
create
(
:todo
,
:marked
,
user:
user_1
,
author:
user_2
,
project:
project_1
,
target:
issue
)
create
(
:todo
,
:marked
,
user:
user_1
,
author:
user_2
,
project:
project_1
,
target:
issue
1
)
end
it
'filters by Assigned'
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