BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
46cacbe5
Commit
46cacbe5
authored
Nov 07, 2017
by
George Andrinopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature test to milestone
parent
561693ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
milestone_spec.rb
spec/features/milestone_spec.rb
+29
-0
milestoneish_spec.rb
spec/models/concerns/milestoneish_spec.rb
+6
-0
No files found.
spec/features/milestone_spec.rb
View file @
46cacbe5
...
...
@@ -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 @
46cacbe5
...
...
@@ -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