gitlab-org--gitlab-foss/spec
Rémy Coutable 8bdb5b6aec Merge branch '1548-average-commits-per-day' into 'master'
Fix: Infinity Bug in Commit Statistics

## What does this MR do?

It fixes a logic bug in the commits statistics: The code assumed that the amount of days involved in a commit range is equal to the difference between the first and last date. This is not true, though, as (from a human standpoint), a commit yesterday and a commit today involve two days, not one. Similarly, a fresh project with only commits made today already 'used' one day.

Since the number of involved days used to be zero for new projects, the result for commits per day quite often amounted to `Infinity`…

## Are there points in the code the reviewer needs to double check?

The test file. I hope it is up to the standards of GitLab.

## Why was this MR needed?

The bug occurres especially for new users with their first project while exploring GitLab.

## What are the relevant issue numbers?

This bug was reported as #1548.

## Screenshots (if relevant)

See merge request !4231
2016-07-08 15:20:22 +00:00
..
config
controllers Revert "Revert "Merge branch 'issue_3946' into 'master' "" 2016-07-07 23:48:02 -04:00
factories Merge branch 'new-diff-notes' into 'master' 2016-07-07 20:45:03 +00:00
features Merge branch '9127-link-report-to-profile' into 'master' 2016-07-08 04:59:40 +00:00
finders Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
fixtures Display new diff notes and allow creation through the web interface 2016-07-06 18:51:00 -04:00
helpers Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
initializers Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
javascripts Merge branch 'emoji-menu-stick-search' into 'master' 2016-06-27 18:03:08 +00:00
lib Merge branch '1548-average-commits-per-day' into 'master' 2016-07-08 15:20:22 +00:00
mailers Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
models Merge branch 'feature/option-set-new-users-external' into 'master' 2016-07-08 08:29:18 +00:00
requests API: Expose shared projects in a group 2016-07-08 13:06:17 +02:00
routing Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
services Add comment with diff to DiffPositionUpdateService spec 2016-07-07 16:14:57 -04:00
support Improve the error message displayed when branch creation fails. 2016-07-05 11:05:16 +05:30
tasks/gitlab Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
views Do not show build retry link when build is active 2016-06-30 11:06:19 +02:00
workers Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
factories_spec.rb
rails_helper.rb
spec_helper.rb Remove coveralls lines 2016-06-30 19:52:36 +02:00
teaspoon_env.rb