diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/support/shared_contexts/requests/api/terraform_modules_shared_context.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/support/shared_contexts/requests/api/terraform_modules_shared_context.rb')
-rw-r--r-- | spec/support/shared_contexts/requests/api/terraform_modules_shared_context.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/requests/api/terraform_modules_shared_context.rb b/spec/support/shared_contexts/requests/api/terraform_modules_shared_context.rb new file mode 100644 index 00000000000..359664ee4f3 --- /dev/null +++ b/spec/support/shared_contexts/requests/api/terraform_modules_shared_context.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +RSpec.shared_context 'for terraform modules api setup' do + include PackagesManagerApiSpecHelpers + include WorkhorseHelpers + + let_it_be_with_reload(:group) { create(:group) } + let_it_be_with_reload(:project) { create(:project, namespace: group) } + let_it_be(:package) { create(:terraform_module_package, project: project) } + let_it_be(:personal_access_token) { create(:personal_access_token) } + let_it_be(:user) { personal_access_token.user } + let_it_be(:job) { create(:ci_build, :running, user: user, project: project) } + let_it_be(:deploy_token) { create(:deploy_token, read_package_registry: true, write_package_registry: true) } + let_it_be(:project_deploy_token) { create(:project_deploy_token, deploy_token: deploy_token, project: project) } + + let(:headers) { {} } + let(:token) { tokens[token_type] } + + let(:tokens) do + { + personal_access_token: personal_access_token.token, + deploy_token: deploy_token.token, + job_token: job.token, + invalid: 'invalid-token123' + } + end +end |