2016-11-16 06:01:10 -05:00
|
|
|
require 'spec_helper'
|
2016-11-17 07:22:27 -05:00
|
|
|
require 'lib/gitlab/cycle_analytics/shared_event_spec'
|
2016-11-16 06:01:10 -05:00
|
|
|
|
2016-11-17 07:22:27 -05:00
|
|
|
describe Gitlab::CycleAnalytics::PlanEvent do
|
2016-11-18 02:13:34 -05:00
|
|
|
it_behaves_like 'default query config' do
|
|
|
|
it 'has the default order' do
|
|
|
|
expect(event.order).to eq(event.start_time_attrs)
|
|
|
|
end
|
2016-11-23 03:10:04 -05:00
|
|
|
|
|
|
|
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
|
2016-11-16 06:01:10 -05:00
|
|
|
end
|
|
|
|
end
|