summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/cycle_analytics
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-23 09:10:04 +0100
committerJames Lopez <james@jameslopez.es>2016-11-23 09:10:04 +0100
commitb938aa5cc83ffb51b516c7abfaaf6fe5e37031a6 (patch)
tree6e3c4150fe720453b6c55785f2c77efb64059cf8 /spec/lib/gitlab/cycle_analytics
parentb1b5060dbad15975184ec20a1914c7c48fc804db (diff)
downloadgitlab-ce-b938aa5cc83ffb51b516c7abfaaf6fe5e37031a6.tar.gz
Fix and relevant spec for plan stage breaking with nil commitsfix/cycle-analytics-plan-issue
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
-rw-r--r--spec/lib/gitlab/cycle_analytics/plan_event_spec.rb8
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