gitlab-org--gitlab-foss/spec/serializers/analytics_stage_serializer_...

25 lines
671 B
Ruby
Raw Normal View History

require 'spec_helper'
describe AnalyticsStageSerializer do
subject do
described_class.new.represent(resource)
end
let(:resource) do
Gitlab::CycleAnalytics::CodeStage.new(project: double, options: {})
end
before do
2016-12-09 15:38:59 +00:00
allow_any_instance_of(Gitlab::CycleAnalytics::BaseStage).to receive(:median).and_return(1.12)
2016-12-02 16:09:29 +00:00
allow_any_instance_of(Gitlab::CycleAnalytics::BaseEventFetcher).to receive(:event_result).and_return({})
end
it 'it generates payload for single object' do
expect(subject).to be_kind_of Hash
end
it 'contains important elements of AnalyticsStage' do
expect(subject).to include(:title, :description, :value)
end
end