diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-23 13:13:29 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-11-23 13:13:29 +0300 |
commit | db02af3e2496203890c9ab1aa5a17eb891071682 (patch) | |
tree | 4116bb60b828d4ec543332e09f5f1225a5c98e50 /spec | |
parent | 9f7fc6a0434399170ce1b089a6b00e11d0880f16 (diff) | |
parent | b938aa5cc83ffb51b516c7abfaaf6fe5e37031a6 (diff) |
Merge branch 'fix/cycle-analytics-plan-issue' into 'master'
Fix cycle analytics plan stage when commits are missing
Takes into account when commits are `nil` so the app doesn't throw an exception and also removes them.
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24836
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !7694
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/cycle_analytics/plan_event_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb b/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb index d76a255acf5..4a5604115ec 100644 --- a/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb @@ -6,5 +6,13 @@ describe Gitlab::CycleAnalytics::PlanEvent do it 'has the default order' do expect(event.order).to eq(event.start_time_attrs) end + + context 'no commits' do + it 'does not blow up if there are no commits' do + allow_any_instance_of(Gitlab::CycleAnalytics::EventsQuery).to receive(:execute).and_return([{}]) + + expect { event.fetch }.not_to raise_error + end + end end end |