gitlab-org--gitlab-foss/spec/lib/gitlab
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
..
backend Create (if necessary) and link the gitlab-shell secret file on the rake install task 2016-06-29 22:30:33 -04:00
badge
bitbucket_import Make Omniauth providers specs to not modify global configuration 2016-06-08 16:50:05 +02:00
ci Merge branch 'refactor/ci-config-move-global-entries' into 'master' 2016-07-05 08:37:16 +00:00
database Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
diff Add tests for Position 2016-07-06 18:51:01 -04:00
email
fogbugz_import Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
gfm
git Improve the error message displayed when branch creation fails. 2016-07-05 11:05:16 +05:30
github_import Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
gitlab_import Make Omniauth providers specs to not modify global configuration 2016-06-08 16:50:05 +02:00
gitorious_import
google_code_import Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
graphs
import_export Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
ldap Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
lfs Add test coverage to LFS fetching 2016-06-21 11:26:44 +02:00
metrics RailsCache metrics now includes fetch_hit/fetch_miss and read_hit/read_miss info. 2016-07-05 12:28:06 +02:00
middleware
o_auth Merge branch 'master' into dev-master 2016-07-02 22:58:21 +02:00
saml Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
sanitizers Improved SVG sanitizer specs to include smoke tests for clean. 2016-06-12 21:05:58 -04:00
sherlock
sql
template Refactor Gitlab::Gitignores 2016-06-20 14:48:28 -05:00
akismet_helper_spec.rb
asciidoc_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
auth_spec.rb Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
award_emoji_spec.rb Fix emoji paths in relative root configurations 2016-07-01 09:10:12 -07:00
blame_spec.rb
build_data_builder_spec.rb
closing_issue_extractor_spec.rb
color_schemes_spec.rb
current_settings_spec.rb Handle case when Redis cache returns an empty setting 2016-06-29 14:28:41 -07:00
database_spec.rb
exclusive_lease_spec.rb
git_access_spec.rb Revert back to not defining a default Git access protocol. 2016-07-05 16:54:22 -05:00
git_access_wiki_spec.rb Rename ENV['PROTOCOL'] to ENV['GL_PROTOCOL'] to conform to what GitLab Shell expects and make the protocol param in GitAccess mandatory. 2016-07-05 16:54:22 -05:00
highlight_spec.rb support cgi style options, such as erb?parent=json 2016-06-27 14:17:49 -07:00
incoming_email_spec.rb
key_fingerprint_spec.rb
lazy_spec.rb
markup_helper_spec.rb
metrics_spec.rb
note_data_builder_spec.rb Add DiffNote model 2016-07-06 18:50:59 -04:00
popen_spec.rb Enable Style/UnneededCapitalW Rubocop cop 2016-06-30 13:31:52 +02:00
project_search_results_spec.rb Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
push_data_builder_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
reference_extractor_spec.rb Remove JiraIssue model and replace references with ExternalIssue 2016-06-16 01:25:18 +03:00
regex_spec.rb
search_results_spec.rb Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
snippet_search_results_spec.rb
themes_spec.rb
upgrader_spec.rb
uploads_transfer_spec.rb
url_builder_spec.rb Add DiffNote model 2016-07-06 18:50:59 -04:00
url_sanitizer_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
version_info_spec.rb
workhorse_spec.rb