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
0e60cbf1
Commit
0e60cbf1
authored
Nov 18, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Break time tracking specs into shared_examples.
parent
ff2ee9c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+10
-0
spec/support/time_tracking_shared_examples.rb
spec/support/time_tracking_shared_examples.rb
+65
-0
No files found.
spec/features/issues_spec.rb
View file @
0e60cbf1
...
...
@@ -136,6 +136,16 @@ describe 'Issues', feature: true do
end
end
describe
'Time tracking slash commands'
,
focus:
true
,
js:
true
do
before
do
issue
=
create
(
:issue
,
author:
@user
,
assignee:
@user
,
project:
project
)
project
.
team
<<
[
@user
,
:developer
]
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
it_behaves_like
'issuable time tracker'
end
describe
'Issue info'
do
it
'excludes award_emoji from comment count'
do
issue
=
create
(
:issue
,
author:
@user
,
assignee:
@user
,
project:
project
,
title:
'foobar'
)
...
...
spec/support/time_tracking_shared_examples.rb
0 → 100644
View file @
0e60cbf1
shared_examples
'issuable time tracker'
do
it
'renders the sidebar component empty state'
do
page
.
within
'.issuable-sidebar'
do
expect
(
page
).
to
have_content
'No estimate or time spent'
end
end
it
'updates the sidebar component when estimate is added'
do
submit_time
(
'/estimate 3w 1d 1h'
)
page
.
within
'.time-tracking-estimate-only'
do
expect
(
page
).
to
have_content
'3w 1d 1h'
end
end
it
'updates the sidebar component when spent is added'
do
submit_time
(
'/spend 3w 1d 1h'
)
page
.
within
'.time-tracking-spend-only'
do
expect
(
page
).
to
have_content
'3w 1d 1h'
end
end
it
'shows the comparison when estimate and spent are added'
do
submit_time
(
'/estimate 3w 1d 1h'
)
submit_time
(
'/spend 3w 1d 1h'
)
page
.
within
'.time-tracking-pane-compare'
do
expect
(
page
).
to
have_content
'3w 1d 1h'
end
end
it
'updates the sidebar component when estimate is removed'
do
submit_time
(
'/estimate 3w 1d 1h'
)
submit_time
(
'/remove_estimate'
)
page
.
within
'#issuable-time-tracker'
do
expect
(
page
).
to
have_content
'No estimate or time spent'
end
end
it
'updates the sidebar component when spent is removed'
do
submit_time
(
'/spend 3w 1d 1h'
)
submit_time
(
'/remove_time_spent'
)
page
.
within
'#issuable-time-tracker'
do
expect
(
page
).
to
have_content
'No estimate or time spent'
end
end
it
'shows the help state when icon is clicked'
do
page
.
within
'#issuable-time-tracker'
do
find
(
'.help-button'
).
click
expect
(
page
).
to
have_content
'Track time with slash commands'
expect
(
page
).
to
have_content
'Learn more'
end
end
end
def
submit_time
(
slash_command
)
fill_in
'note[note]'
,
with:
slash_command
click_button
'Comment'
wait_for_ajax
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