diff options
author | James Lopez <james@jameslopez.es> | 2016-11-23 09:10:04 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-23 09:10:04 +0100 |
commit | b938aa5cc83ffb51b516c7abfaaf6fe5e37031a6 (patch) | |
tree | 6e3c4150fe720453b6c55785f2c77efb64059cf8 /spec | |
parent | b1b5060dbad15975184ec20a1914c7c48fc804db (diff) | |
download | gitlab-ce-b938aa5cc83ffb51b516c7abfaaf6fe5e37031a6.tar.gz |
Fix and relevant spec for plan stage breaking with nil commitsfix/cycle-analytics-plan-issue
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 |