Commit c7d850eb authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '201727-follow-up-refactoring' into 'master'

Resolve "Follow-up from "Support `license_scanning` in MR and Pipeline""

Closes #201727

See merge request gitlab-org/gitlab!24309
parents 898c5da4 9dcff920
......@@ -123,8 +123,6 @@ module EE
end
def expose_license_scanning_data?
return unless available_licensed_report_type?(:license_management)
batch_lookup_report_artifact_for_file_type(:license_scanning).present?
end
......
......@@ -123,7 +123,7 @@ describe Ci::Pipeline do
describe '#batch_lookup_report_artifact_for_file_type' do
subject(:artifact) { pipeline.batch_lookup_report_artifact_for_file_type(file_type) }
let!(:build) { create(:ee_ci_build, artifact_type, :success, pipeline: pipeline) }
let(:build_artifact) { build.job_artifacts.sample }
context 'with security report artifact' do
let!(:build) { create(:ee_ci_build, :dependency_scanning, :success, pipeline: pipeline) }
......@@ -134,7 +134,7 @@ describe Ci::Pipeline do
end
it 'returns right kind of artifacts' do
expect(artifact.file_type).to eq file_type.to_s
is_expected.to eq(build_artifact)
end
context 'when looking for other type of artifact' do
......@@ -158,7 +158,7 @@ describe Ci::Pipeline do
let(:file_type) { :license_scanning }
it 'returns artifact' do
is_expected.to be_kind_of Ci::JobArtifact
is_expected.to eq(build_artifact)
end
end
......@@ -166,7 +166,7 @@ describe Ci::Pipeline do
let(:file_type) { :license_management }
it 'returns artifact' do
is_expected.to be_kind_of Ci::JobArtifact
is_expected.to eq(build_artifact)
end
end
end
......
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