plan_event_spec.rb 564 Bytes
Newer Older
1
require 'spec_helper'
2
require 'lib/gitlab/cycle_analytics/shared_event_spec'
3

4
describe Gitlab::CycleAnalytics::PlanEvent do
James Lopez's avatar
James Lopez committed
5 6
  let(:stage_name) { :plan }

James Lopez's avatar
James Lopez committed
7 8 9 10
  it_behaves_like 'default query config' do
    it 'has the default order' do
      expect(event.order).to eq(event.start_time_attrs)
    end
11 12 13 14 15 16 17 18

    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
19 20
  end
end