diff options
Diffstat (limited to 'spec/lib/gitlab/analytics')
-rw-r--r-- | spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb b/spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb index ebc5ae2a632..4fe55ba0c0c 100644 --- a/spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb +++ b/spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb @@ -79,56 +79,6 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::RecordsFetcher do include_context 'when records are loaded by maintainer' end - - describe 'special case' do - let(:mr1) { create(:merge_request, source_project: project, allow_broken: true, created_at: 20.days.ago) } - let(:mr2) { create(:merge_request, source_project: project, allow_broken: true, created_at: 19.days.ago) } - let(:ci_build1) { create(:ci_build) } - let(:ci_build2) { create(:ci_build) } - let(:default_stages) { Gitlab::Analytics::CycleAnalytics::DefaultStages } - let(:stage) { build(:cycle_analytics_project_stage, default_stages.params_for_test_stage.merge(project: project)) } - - before do - mr1.metrics.update!({ - merged_at: 5.days.ago, - first_deployed_to_production_at: 1.day.ago, - latest_build_started_at: 5.days.ago, - latest_build_finished_at: 1.day.ago, - pipeline: ci_build1.pipeline - }) - mr2.metrics.update!({ - merged_at: 10.days.ago, - first_deployed_to_production_at: 5.days.ago, - latest_build_started_at: 9.days.ago, - latest_build_finished_at: 7.days.ago, - pipeline: ci_build2.pipeline - }) - - project.add_user(user, Gitlab::Access::MAINTAINER) - end - - context 'returns build records' do - shared_examples 'orders build records by `latest_build_finished_at`' do - it 'orders by `latest_build_finished_at`' do - build_ids = subject.map { |item| item[:id] } - - expect(build_ids).to eq([ci_build1.id, ci_build2.id]) - end - end - - context 'when requesting records for default test stage' do - include_examples 'orders build records by `latest_build_finished_at`' - end - - context 'when requesting records for default staging stage' do - before do - stage.assign_attributes(default_stages.params_for_staging_stage) - end - - include_examples 'orders build records by `latest_build_finished_at`' - end - end - end end describe 'pagination' do |