summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/lfs_token_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 13:38:58 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 13:45:28 +0200
commit6d43c95b7011ec7ec4600e00bdc8df76bb39813c (patch)
treef9ee7a65904f14286d302d1af51add94922fb50d /spec/lib/gitlab/lfs_token_spec.rb
parent79f60e2b5cf388416cdc5948e19ae0401f97d353 (diff)
downloadgitlab-ce-6d43c95b7011ec7ec4600e00bdc8df76bb39813c.tar.gz
Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043
Diffstat (limited to 'spec/lib/gitlab/lfs_token_spec.rb')
-rw-r--r--spec/lib/gitlab/lfs_token_spec.rb51
1 files changed, 0 insertions, 51 deletions
diff --git a/spec/lib/gitlab/lfs_token_spec.rb b/spec/lib/gitlab/lfs_token_spec.rb
deleted file mode 100644
index 9f04f67e0a8..00000000000
--- a/spec/lib/gitlab/lfs_token_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LfsToken, lib: true do
- describe '#generate and #value' do
- shared_examples 'an LFS token generator' do
- it 'returns a randomly generated token' do
- token = handler.generate
-
- expect(token).not_to be_nil
- expect(token).to be_a String
- expect(token.length).to eq 50
- end
-
- it 'returns the correct token based on the key' do
- token = handler.generate
-
- expect(handler.value).to eq(token)
- end
- end
-
- context 'when the actor is a user' do
- let(:actor) { create(:user) }
- let(:handler) { described_class.new(actor) }
-
- it_behaves_like 'an LFS token generator'
-
- it 'returns the correct username' do
- expect(handler.actor_name).to eq(actor.username)
- end
-
- it 'returns the correct token type' do
- expect(handler.type).to eq(:lfs_token)
- end
- end
-
- context 'when the actor is a deploy key' do
- let(:actor) { create(:deploy_key) }
- let(:handler) { described_class.new(actor) }
-
- it_behaves_like 'an LFS token generator'
-
- it 'returns the correct username' do
- expect(handler.actor_name).to eq("lfs+deploy-key-#{actor.id}")
- end
-
- it 'returns the correct token type' do
- expect(handler.type).to eq(:lfs_deploy_token)
- end
- end
- end
-end