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
cdf9f1d1
Commit
cdf9f1d1
authored
Nov 07, 2017
by
George Andrinopoulos
Committed by
Winnie Hellmann
Nov 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature test to milestone
parent
d27da27b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
spec/features/milestone_spec.rb
spec/features/milestone_spec.rb
+29
-0
spec/models/concerns/milestoneish_spec.rb
spec/models/concerns/milestoneish_spec.rb
+6
-0
No files found.
spec/features/milestone_spec.rb
View file @
cdf9f1d1
...
...
@@ -65,4 +65,33 @@ feature 'Milestone' do
expect
(
find
(
'.alert-danger'
)).
to
have_content
(
'already being used for another group or project milestone.'
)
end
end
feature
'Open a milestone'
do
scenario
'shows total issue time spent correctly when no time has been logged'
do
milestone
=
create
(
:milestone
,
project:
project
,
title:
8.7
)
visit
project_milestone_path
(
project
,
milestone
)
page
.
within
(
'.block.time_spent'
)
do
expect
(
page
).
to
have_content
'No time spent'
expect
(
page
).
to
have_content
'None'
end
end
scenario
'shows total issue time spent'
do
milestone
=
create
(
:milestone
,
project:
project
,
title:
8.7
)
issue1
=
create
(
:issue
,
project:
project
,
milestone:
milestone
)
issue2
=
create
(
:issue
,
project:
project
,
milestone:
milestone
)
issue1
.
spend_time
(
duration:
3600
,
user:
user
)
issue1
.
save!
issue2
.
spend_time
(
duration:
7200
,
user:
user
)
issue2
.
save!
visit
project_milestone_path
(
project
,
milestone
)
page
.
within
(
'.block.time_spent'
)
do
expect
(
page
).
to
have_content
'3h'
end
end
end
end
spec/models/concerns/milestoneish_spec.rb
View file @
cdf9f1d1
...
...
@@ -197,4 +197,10 @@ describe Milestone, 'Milestoneish' do
expect
(
milestone
.
total_issue_time_spent
).
to
eq
(
900
)
end
end
describe
'#human_total_issue_time_spent'
do
it
'returns nil if no time has been spent'
do
expect
(
milestone
.
human_total_issue_time_spent
).
to
be_nil
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