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
c6e49881
Commit
c6e49881
authored
Jul 02, 2018
by
Jarka Kadlecová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for epic todos
parent
e4569d25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
7 deletions
+104
-7
ee/spec/features/epics/todo_spec.rb
ee/spec/features/epics/todo_spec.rb
+43
-0
ee/spec/features/epics/update_epic_spec.rb
ee/spec/features/epics/update_epic_spec.rb
+26
-0
spec/features/dashboard/todos/todos_filtering_spec.rb
spec/features/dashboard/todos/todos_filtering_spec.rb
+35
-7
No files found.
ee/spec/features/epics/todo_spec.rb
0 → 100644
View file @
c6e49881
require
'rails_helper'
feature
'Manually create a todo item from epic'
,
:js
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let
(
:user
)
{
create
(
:user
)}
before
do
stub_licensed_features
(
epics:
true
)
sign_in
(
user
)
visit
group_epic_path
(
group
,
epic
)
end
it
'creates todo when clicking button'
do
page
.
within
'.issuable-sidebar'
do
click_button
'Add todo'
expect
(
page
).
to
have_content
'Mark todo as done'
end
page
.
within
'.header-content .todos-count'
do
expect
(
page
).
to
have_content
'1'
end
end
it
'marks a todo as done'
do
page
.
within
'.issuable-sidebar'
do
click_button
'Add todo'
end
expect
(
page
).
to
have_selector
(
'.todos-count'
,
visible:
true
)
page
.
within
'.header-content .todos-count'
do
expect
(
page
).
to
have_content
'1'
end
page
.
within
'.issuable-sidebar'
do
click_button
'Mark todo as done'
end
expect
(
page
).
to
have_selector
(
'.todos-count'
,
visible:
false
)
end
end
ee/spec/features/epics/update_epic_spec.rb
View file @
c6e49881
...
...
@@ -57,6 +57,32 @@ feature 'Update Epic', :js do
expect
(
find
(
'.issuable-details .description'
)).
to
have_content
(
'New epic description'
)
end
it
'creates a todo only for mentioned users'
do
mentioned
=
create
(
:user
)
fill_in
'issue-description'
,
with:
"FYI
#{
mentioned
.
to_reference
}
"
click_button
'Save changes'
expect
(
find
(
'.issuable-details h2.title'
)).
to
have_content
(
'title'
)
visit
dashboard_todos_path
expect
(
page
).
to
have_selector
(
'.todos-list .todo'
,
count:
0
)
sign_in
(
mentioned
)
visit
dashboard_todos_path
page
.
within
'.header-content .todos-count'
do
expect
(
page
).
to
have_content
'1'
end
expect
(
page
).
to
have_selector
(
'.todos-list .todo'
,
count:
1
)
within
first
(
'.todo'
)
do
expect
(
page
).
to
have_content
"epic
#{
epic
.
to_reference
(
full:
true
)
}
"
end
end
it
'edits full screen'
do
page
.
within
(
'.detail-page-description'
)
{
find
(
'.js-zen-enter'
).
click
}
...
...
spec/features/dashboard/todos/todos_filtering_spec.rb
View file @
c6e49881
...
...
@@ -4,23 +4,36 @@ feature '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
...
...
@@ -34,6 +47,20 @@ feature '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'
...
...
@@ -63,7 +90,7 @@ feature '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
)
...
...
@@ -92,14 +119,15 @@ feature '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