Commit 19bf148a authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '12917-dl-api-ping' into 'master'

Resolve "API Dependency List - usage ping"

See merge request gitlab-org/gitlab!21664
parents 1ec12b73 c2eb23e1
......@@ -35,6 +35,8 @@ module API
get ':id/dependencies' do
authorize! :read_dependencies, user_project
track_event('view_dependencies')
dependencies = dependencies_by(declared_params.merge(project: user_project))
present dependencies, with: ::EE::API::Entities::Dependency, user: current_user, project: user_project
......
......@@ -7,13 +7,16 @@ describe API::Dependencies do
set(:user) { create(:user) }
describe "GET /projects/:id/dependencies" do
let(:request) { get api("/projects/#{project.id}/dependencies", user), params: params }
subject(:request) { get api("/projects/#{project.id}/dependencies", user), params: params }
let(:params) { {} }
before do
stub_licensed_features(dependency_scanning: true, security_dashboard: true)
end
it_behaves_like 'a gitlab tracking event', described_class.name, 'view_dependencies'
context 'with an authorized user with proper permissions' do
before do
create(:ee_ci_pipeline, :with_dependency_list_report, project: project)
......
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