Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-22 15:10:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-22 15:10:30 +0300
commit49203bfa3c7eb607a7561ae7da9b5c52aa49fd77 (patch)
treef33cd54ec9a45d69a3e58fe93735070d3b718913 /spec/controllers
parent3c9a2dd62025043448c9ea9a6df86422874ee4be (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb28
1 files changed, 23 insertions, 5 deletions
diff --git a/spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb b/spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb
index 6bb791d2fd4..d5425428ec9 100644
--- a/spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb
+++ b/spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb
@@ -119,11 +119,7 @@ RSpec.describe Groups::DependencyProxyForContainersController, feature_category:
end
shared_examples 'authorize action with permission' do
- context 'with a valid user' do
- before do
- group.add_guest(user)
- end
-
+ shared_examples 'sends Workhorse instructions' do
it 'sends Workhorse local file instructions', :aggregate_failures do
subject
@@ -144,6 +140,28 @@ RSpec.describe Groups::DependencyProxyForContainersController, feature_category:
expect(json_response['MaximumSize']).to eq(maximum_size)
end
end
+
+ before do
+ group.add_guest(user)
+ end
+
+ context 'with a valid user' do
+ it_behaves_like 'sends Workhorse instructions'
+ end
+
+ context 'with a valid group access token' do
+ let_it_be(:user) { create(:user, :project_bot) }
+ let_it_be_with_reload(:token) { create(:personal_access_token, user: user) }
+
+ it_behaves_like 'sends Workhorse instructions'
+ end
+
+ context 'with a deploy token' do
+ let_it_be(:user) { create(:deploy_token, :dependency_proxy_scopes, :group) }
+ let_it_be(:group_deploy_token) { create(:group_deploy_token, deploy_token: user, group: group) }
+
+ it_behaves_like 'sends Workhorse instructions'
+ end
end
shared_examples 'namespace statistics refresh' do