summaryrefslogtreecommitdiff
path: root/spec/gitlab_net_spec.rb
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2018-11-07 10:07:52 +1100
committerAsh McKenzie <amckenzie@gitlab.com>2018-11-08 09:52:10 +1100
commit1c6a8d1d70c1603c73fb9bcb8f440dbf97988e89 (patch)
treea83d262d697d3d5265716ddd8bf7650870063eca /spec/gitlab_net_spec.rb
parent9cf3334cb5cdf871266a2b9538589e36efd788e1 (diff)
downloadgitlab-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.rb27
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