summaryrefslogtreecommitdiff
path: root/spec/gitlab_lfs_authentication_spec.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-10-14 16:00:48 +0100
committerNick Thomas <nick@gitlab.com>2019-10-15 07:44:13 +0100
commit18096b5440e0818605add32538751c6be38e8343 (patch)
treeb4aebac9d7f752156ee4ec3d44ee990021a1b295 /spec/gitlab_lfs_authentication_spec.rb
parent8db304b4919519bca60a5b18ffe9b88dcde845af (diff)
downloadgitlab-shell-18096b5440e0818605add32538751c6be38e8343.tar.gz
Remove dead Ruby code
Diffstat (limited to 'spec/gitlab_lfs_authentication_spec.rb')
-rw-r--r--spec/gitlab_lfs_authentication_spec.rb57
1 files changed, 0 insertions, 57 deletions
diff --git a/spec/gitlab_lfs_authentication_spec.rb b/spec/gitlab_lfs_authentication_spec.rb
deleted file mode 100644
index acc9e3d..0000000
--- a/spec/gitlab_lfs_authentication_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require 'spec_helper'
-require 'gitlab_lfs_authentication'
-require 'json'
-
-describe GitlabLfsAuthentication do
- let(:payload_from_gitlab_api) do
- {
- username: 'dzaporozhets',
- lfs_token: 'wsnys8Zm8Jn7zyhHTAAK',
- repository_http_path: 'http://gitlab.dev/repo'
- }
- end
-
- subject do
- GitlabLfsAuthentication.build_from_json(
- JSON.generate(payload_from_gitlab_api)
- )
- end
-
- describe '#build_from_json' do
- it { expect(subject.username).to eq('dzaporozhets') }
- it { expect(subject.lfs_token).to eq('wsnys8Zm8Jn7zyhHTAAK') }
- it { expect(subject.repository_http_path).to eq('http://gitlab.dev/repo') }
- end
-
- describe '#authentication_payload' do
- shared_examples 'a valid payload' do
- it 'should be proper JSON' do
- payload = subject.authentication_payload
- json_payload = JSON.parse(payload)
-
- expect(json_payload['header']['Authorization']).to eq('Basic ZHphcG9yb3poZXRzOndzbnlzOFptOEpuN3p5aEhUQUFL')
- expect(json_payload['href']).to eq('http://gitlab.dev/repo/info/lfs')
- end
- end
-
- context 'without expires_in' do
- let(:result) { { 'header' => { 'Authorization' => 'Basic ZHphcG9yb3poZXRzOndzbnlzOFptOEpuN3p5aEhUQUFL' }, 'href' => 'http://gitlab.dev/repo/info/lfs' }.to_json }
-
- it { expect(subject.authentication_payload).to eq(result) }
-
- it_behaves_like 'a valid payload'
- end
-
- context 'with expires_in' do
- let(:result) { { 'header' => { 'Authorization' => 'Basic ZHphcG9yb3poZXRzOndzbnlzOFptOEpuN3p5aEhUQUFL' }, 'href' => 'http://gitlab.dev/repo/info/lfs', 'expires_in' => 1800 }.to_json }
-
- before do
- payload_from_gitlab_api[:expires_in] = 1800
- end
-
- it { expect(subject.authentication_payload).to eq(result) }
-
- it_behaves_like 'a valid payload'
- end
- end
-end