blob: de2300c354bfdc661ec020dd733ddccdd84f9dde (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Ci::CompareCodequalityReportsService, feature_category: :continuous_integration do
let(:service) { described_class.new(project) }
let(:project) { create(:project, :repository) }
describe '#execute' do
subject { service.execute(base_pipeline, head_pipeline) }
context 'when head pipeline has a codequality report' do
let(:base_pipeline) { nil }
let(:head_pipeline) { create(:ci_pipeline, :with_codequality_reports, project: project) }
it 'returns status and data' do
expect(subject[:status]).to eq(:parsed)
expect(subject[:data]).to match_schema('entities/codequality_reports_comparer')
end
end
context 'when base and head pipelines have codequality reports' do
let(:base_pipeline) { create(:ci_pipeline, :with_codequality_reports, project: project) }
let(:head_pipeline) { create(:ci_pipeline, :with_codequality_reports, project: project) }
it 'returns status and data' do
expect(subject[:status]).to eq(:parsed)
expect(subject[:data]).to match_schema('entities/codequality_reports_comparer')
end
end
end
end
|