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
8595ff79
Commit
8595ff79
authored
Mar 31, 2017
by
Felipe Artur
Committed by
Mike Greiling
Apr 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show chart only until current date when milestone due date is bigger
parent
d36d04f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
app/models/burndown.rb
app/models/burndown.rb
+5
-4
spec/models/burndown_spec.rb
spec/models/burndown_spec.rb
+6
-0
No files found.
app/models/burndown.rb
View file @
8595ff79
...
...
@@ -2,11 +2,12 @@ class Burndown
attr_accessor
:start_date
,
:end_date
,
:issues_count
,
:issues_weight
def
initialize
(
milestone
)
@milestone
=
milestone
@start_date
=
@milestone
.
start_date
@end_date
=
@milestone
.
due_date
@milestone
=
milestone
@start_date
=
@milestone
.
start_date
@end_date
=
@milestone
.
due_date
@end_date
=
Date
.
today
if
@end_date
.
present?
&&
@end_date
>
Date
.
today
issues
=
@milestone
.
issues
issues
=
@milestone
.
issues
@issues_count
=
issues
.
count
@issues_weight
=
issues
.
sum
(
:weight
)
...
...
spec/models/burndown_spec.rb
View file @
8595ff79
...
...
@@ -50,6 +50,12 @@ describe Burndown, models: true do
expect
(
subject
).
to
eq
([])
end
it
"it counts until today if milestone due date > Date.today"
do
Timecop
.
travel
(
milestone
.
due_date
-
1
.
day
)
expect
(
subject
.
last
[
0
]).
to
eq
(
Time
.
now
.
strftime
(
"%Y-%m-%d"
))
end
# Creates, closes and reopens issues only for odd days numbers
def
build_sample
milestone
.
start_date
.
upto
(
milestone
.
due_date
)
do
|
date
|
...
...
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