diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/controllers/projects/repositories_controller_spec.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/controllers/projects/repositories_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/repositories_controller_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/projects/repositories_controller_spec.rb b/spec/controllers/projects/repositories_controller_spec.rb index f7cf55d8a95..1370ec9cc0b 100644 --- a/spec/controllers/projects/repositories_controller_spec.rb +++ b/spec/controllers/projects/repositories_controller_spec.rb @@ -210,6 +210,25 @@ RSpec.describe Projects::RepositoriesController do expect(response).to have_gitlab_http_status(:found) end end + + context 'when token is migrated' do + let(:user) { create(:user, static_object_token: '') } + let(:token) { 'Test' } + + it 'calls the action normally' do + user.update_column(:static_object_token, token) + + get :archive, params: { namespace_id: project.namespace, project_id: project, id: 'master', token: token }, format: 'zip' + expect(user.static_object_token).to eq(token) + expect(response).to have_gitlab_http_status(:ok) + + user.update_column(:static_object_token_encrypted, Gitlab::CryptoHelper.aes256_gcm_encrypt(token)) + + get :archive, params: { namespace_id: project.namespace, project_id: project, id: 'master', token: token }, format: 'zip' + expect(user.static_object_token).to eq(token) + expect(response).to have_gitlab_http_status(:ok) + end + end end context 'when a token header is present' do |