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:
Diffstat (limited to 'spec/services/dependency_proxy/auth_token_service_spec.rb')
-rw-r--r--spec/services/dependency_proxy/auth_token_service_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/dependency_proxy/auth_token_service_spec.rb b/spec/services/dependency_proxy/auth_token_service_spec.rb
index 4b96f9d75a9..6214d75dfa0 100644
--- a/spec/services/dependency_proxy/auth_token_service_spec.rb
+++ b/spec/services/dependency_proxy/auth_token_service_spec.rb
@@ -14,6 +14,19 @@ RSpec.describe DependencyProxy::AuthTokenService do
result = subject
expect(result['user_id']).to eq(user.id)
+ expect(result['deploy_token']).to be_nil
+ end
+
+ context 'with a deploy token' do
+ let_it_be(:deploy_token) { create(:deploy_token) }
+ let_it_be(:token) { build_jwt(deploy_token) }
+
+ it 'returns the deploy token' do
+ result = subject
+
+ expect(result['deploy_token']).to eq(deploy_token.token)
+ expect(result['user_id']).to be_nil
+ end
end
it 'raises an error if the token is expired' do