summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-09-26 10:03:57 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-09-26 18:38:40 +0530
commitc0ecef79fe936b9e71384f8d951fc5503f26f4a7 (patch)
treef1be52fe5ff1773036defe22f5f7d232cac3c40c /spec/models
parentf1bfb872877df7baf36d2de1ad5dfdb4c8604c9b (diff)
downloadgitlab-ce-c0ecef79fe936b9e71384f8d951fc5503f26f4a7.tar.gz
Fix the "Commits" section of the cycle analytics summary.
- The commit count was capped at 10, due to `Gitlab::Git::Repository#log` enforcing a limit, with the default set to 10. - Reimplement a small portion of this `log` function to get just the data we need.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/cycle_analytics/summary_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/cycle_analytics/summary_spec.rb b/spec/models/cycle_analytics/summary_spec.rb
index 743bc2da33f..9d67bc82cba 100644
--- a/spec/models/cycle_analytics/summary_spec.rb
+++ b/spec/models/cycle_analytics/summary_spec.rb
@@ -34,6 +34,12 @@ describe CycleAnalytics::Summary, models: true do
expect(subject.commits).to eq(0)
end
+
+ it "finds a large (> 100) snumber of commits if present" do
+ Timecop.freeze(5.days.from_now) { create_commit("Test message", project, user, 'master', count: 100) }
+
+ expect(subject.commits).to eq(100)
+ end
end
describe "#deploys" do