Commit daa4f3de authored by James Lopez's avatar James Lopez

fix spec failures after merge

parent 58dddcdf
......@@ -11,7 +11,7 @@ describe Gitlab::CycleAnalytics::PlanEvent do
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([{}])
allow_any_instance_of(Gitlab::CycleAnalytics::MetricsFetcher).to receive(:events).and_return([{}])
expect { event.fetch }.not_to raise_error
end
......
......@@ -7,7 +7,7 @@ shared_examples 'default query config' do
branch: nil)
end
let(:event) { described_class.new(fetcher: fetcher, stage: stage_name, options: {}) }
let(:event) { described_class.new(fetcher: fetcher, options: {}) }
it 'has the start attributes' do
expect(event.start_time_attrs).not_to be_nil
......
require 'spec_helper'
shared_examples 'base stage' do
let(:stage) { described_class.new(project: double, options: {}, stage: stage_name) }
let(:stage) { described_class.new(project: double, options: {}) }
before do
allow_any_instance_of(Gitlab::CycleAnalytics::MetricsFetcher).to receive(:median).and_return(1.12)
......@@ -20,8 +20,8 @@ shared_examples 'base stage' do
expect(stage.median_data[:description]).not_to be_nil
end
it 'has the stage' do
expect(stage.stage).to eq(stage_name)
it 'has the title' do
expect(stage.title).to eq(stage_name.to_s.capitalize)
end
it 'has the events' do
......
......@@ -7,7 +7,7 @@ describe AnalyticsStageSerializer do
end
let(:json) { serializer.as_json }
let(:resource) { Gitlab::CycleAnalytics::CodeStage.new(project: double, options: {}, stage: :code) }
let(:resource) { Gitlab::CycleAnalytics::CodeStage.new(project: double, options: {}) }
before do
allow_any_instance_of(Gitlab::CycleAnalytics::MetricsFetcher).to receive(:median).and_return(1.12)
......@@ -15,7 +15,7 @@ describe AnalyticsStageSerializer do
end
it 'it generates payload for single object' do
expect(json).to be_an_instance_of Hash
expect(json).to be_kind_of Hash
end
it 'contains important elements of AnalyticsStage' do
......
......@@ -8,14 +8,19 @@ describe AnalyticsSummarySerializer do
let(:json) { serializer.as_json }
let(:project) { create(:empty_project) }
let(:resource) { Gitlab::CycleAnalytics::Summary::Issue.new(project: double, from: 1.day.ago) }
let(:user) { create(:user) }
let(:resource) do
Gitlab::CycleAnalytics::Summary::Issue.new(project: double,
from: 1.day.ago,
current_user: user)
end
before do
allow_any_instance_of(Gitlab::CycleAnalytics::Summary::Issue).to receive(:value).and_return(1.12)
end
it 'it generates payload for single object' do
expect(json).to be_an_instance_of Hash
expect(json).to be_kind_of Hash
end
it 'contains important elements of AnalyticsStage' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment