Commit 5468ce7e authored by James Lopez's avatar James Lopez

Merge branch '205302-update-controller-tests' into 'master'

Use 'license_scanning' in controller tests

See merge request gitlab-org/gitlab!27819
parents 3e84363d ae5c724f
...@@ -163,7 +163,7 @@ describe Projects::DependenciesController do ...@@ -163,7 +163,7 @@ describe Projects::DependenciesController do
context 'with found license report' do context 'with found license report' do
let(:user) { developer } let(:user) { developer }
let(:pipeline) { create(:ee_ci_pipeline, :with_dependency_list_report, project: project) } let(:pipeline) { create(:ee_ci_pipeline, :with_dependency_list_report, project: project) }
let(:license_build) { create(:ee_ci_build, :success, :license_management, pipeline: pipeline) } let(:license_build) { create(:ee_ci_build, :success, :license_scanning, pipeline: pipeline) }
before do before do
pipeline.builds << license_build pipeline.builds << license_build
......
...@@ -43,7 +43,7 @@ describe Projects::LicensesController do ...@@ -43,7 +43,7 @@ describe Projects::LicensesController do
end end
context 'with existing report' do context 'with existing report' do
let!(:pipeline) { create(:ee_ci_pipeline, :with_license_management_report, project: project) } let!(:pipeline) { create(:ee_ci_pipeline, :with_license_scanning_report, project: project) }
before do before do
get_licenses get_licenses
......
...@@ -734,7 +734,7 @@ describe Projects::MergeRequestsController do ...@@ -734,7 +734,7 @@ describe Projects::MergeRequestsController do
end end
describe 'GET #license_management_reports' do describe 'GET #license_management_reports' do
let(:merge_request) { create(:ee_merge_request, :with_license_management_reports, source_project: project, author: create(:user)) } let(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: create(:user)) }
let(:params) do let(:params) do
{ {
namespace_id: project.namespace.to_param, namespace_id: project.namespace.to_param,
......
...@@ -76,10 +76,10 @@ describe Projects::PipelinesController do ...@@ -76,10 +76,10 @@ describe Projects::PipelinesController do
let(:payload) { JSON.parse(licenses_with_json.body) } let(:payload) { JSON.parse(licenses_with_json.body) }
context 'with a license management artifact' do context 'with a license scanning artifact' do
before do before do
build = create(:ci_build, pipeline: pipeline) build = create(:ci_build, pipeline: pipeline)
create(:ee_ci_job_artifact, :license_management, job: build) create(:ee_ci_job_artifact, :license_scanning, job: build)
end end
context 'with feature enabled' do context 'with feature enabled' do
...@@ -99,7 +99,7 @@ describe Projects::PipelinesController do ...@@ -99,7 +99,7 @@ describe Projects::PipelinesController do
stub_licensed_features(license_scanning: true) stub_licensed_features(license_scanning: true)
end end
it 'will return license management report in json format' do it 'will return license scanning report in json format' do
expect(payload.size).to eq(pipeline.license_scanning_report.licenses.size) expect(payload.size).to eq(pipeline.license_scanning_report.licenses.size)
expect(payload.first.keys).to eq(%w(name classification dependencies count url)) expect(payload.first.keys).to eq(%w(name classification dependencies count url))
end end
...@@ -138,7 +138,7 @@ describe Projects::PipelinesController do ...@@ -138,7 +138,7 @@ describe Projects::PipelinesController do
end end
end end
context 'without license management artifact' do context 'without license scanning artifact' do
context 'with feature enabled' do context 'with feature enabled' do
before do before do
stub_licensed_features(license_scanning: true) stub_licensed_features(license_scanning: true)
......
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