diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-11-07 10:07:52 +1100 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-11-08 09:52:10 +1100 |
commit | 1c6a8d1d70c1603c73fb9bcb8f440dbf97988e89 (patch) | |
tree | a83d262d697d3d5265716ddd8bf7650870063eca /spec/gitlab_net_spec.rb | |
parent | 9cf3334cb5cdf871266a2b9538589e36efd788e1 (diff) | |
download | gitlab-shell-ashmckenzie/8114-geo-push-ssh-lfs-http-auth-bug.tar.gz |
Include LFS operation when making auth requestashmckenzie/8114-geo-push-ssh-lfs-http-auth-bug
Operation is either upload or download
Diffstat (limited to 'spec/gitlab_net_spec.rb')
-rw-r--r-- | spec/gitlab_net_spec.rb | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/spec/gitlab_net_spec.rb b/spec/gitlab_net_spec.rb index 0656084..07b772b 100644 --- a/spec/gitlab_net_spec.rb +++ b/spec/gitlab_net_spec.rb @@ -67,12 +67,27 @@ describe GitlabNet, vcr: true do describe '#lfs_authenticate' do context 'lfs authentication succeeded' do - it 'should return the correct data' do - VCR.use_cassette('lfs-authenticate-ok') do - lfs_access = gitlab_net.lfs_authenticate(key, project) - expect(lfs_access.username).to eq('root') - expect(lfs_access.lfs_token).to eq('Hyzhyde_wLUeyUQsR3tHGTG8eNocVQm4ssioTEsBSdb6KwCSzQ') - expect(lfs_access.repository_http_path).to eq(URI.join(internal_api_endpoint.sub('api/v4', ''), project).to_s) + let(:repository_http_path) { URI.join(internal_api_endpoint.sub('api/v4', ''), project).to_s } + + context 'for download operation' do + it 'should return the correct data' do + VCR.use_cassette('lfs-authenticate-ok-download') do + lfs_access = gitlab_net.lfs_authenticate(key, project, 'download') + expect(lfs_access.username).to eq('root') + expect(lfs_access.lfs_token).to eq('Hyzhyde_wLUeyUQsR3tHGTG8eNocVQm4ssioTEsBSdb6KwCSzQ') + expect(lfs_access.repository_http_path).to eq(repository_http_path) + end + end + end + + context 'for upload operation' do + it 'should return the correct data' do + VCR.use_cassette('lfs-authenticate-ok-upload') do + lfs_access = gitlab_net.lfs_authenticate(key, project, 'upload') + expect(lfs_access.username).to eq('root') + expect(lfs_access.lfs_token).to eq('Hyzhyde_wLUeyUQsR3tHGTG8eNocVQm4ssioTEsBSdb6KwCSzQ') + expect(lfs_access.repository_http_path).to eq(repository_http_path) + end end end end |