diff options
author | Nick Thomas <nick@gitlab.com> | 2018-08-14 00:22:46 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-08-14 00:22:46 +0100 |
commit | c8bf2e7d47c3b8f34cb79847edcd5dd50b8f280e (patch) | |
tree | cc22dc6c91f58ccaadd97fdd816159de6ec8a135 /spec/action/git_lfs_authenticate_spec.rb | |
parent | 764f6f47fa6a8698ae033532ae49875a87030518 (diff) | |
download | gitlab-shell-c8bf2e7d47c3b8f34cb79847edcd5dd50b8f280e.tar.gz |
Revert "Merge branch 'ash.mckenzie/srp-refactor' into 'master'"
This reverts commit 3aaf4751e09262c53544a1987f59b1308af9b6c1, reversing
changes made to c6577e0d75f51b017f2f332838b97c3ca5b497c0.
Diffstat (limited to 'spec/action/git_lfs_authenticate_spec.rb')
-rw-r--r-- | spec/action/git_lfs_authenticate_spec.rb | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/spec/action/git_lfs_authenticate_spec.rb b/spec/action/git_lfs_authenticate_spec.rb deleted file mode 100644 index 07e844f..0000000 --- a/spec/action/git_lfs_authenticate_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -require_relative '../spec_helper' -require_relative '../../lib/action/git_lfs_authenticate' - -describe Action::GitLFSAuthenticate do - let(:key_id) { '1' } - let(:repo_name) { 'gitlab-ci.git' } - let(:actor) { Actor::Key.new(key_id) } - let(:username) { 'testuser' } - let(:discover_payload) { { 'username' => username } } - let(:api) { double(GitlabNet) } - - before do - allow(GitlabNet).to receive(:new).and_return(api) - allow(api).to receive(:discover).with(actor).and_return(discover_payload) - end - - subject do - described_class.new(actor, repo_name) - end - - describe '#execute' do - context 'when response from API is not a success' do - before do - expect(api).to receive(:lfs_authenticate).with(actor, repo_name).and_return(nil) - end - - it 'returns nil' do - expect(subject.execute(nil, nil)).to be_nil - end - end - - context 'when response from API is a success' do - let(:username) { 'testuser' } - let(:lfs_token) { '1234' } - let(:repository_http_path) { "/tmp/#{repo_name}" } - let(:gitlab_lfs_authentication) { GitlabLfsAuthentication.new(username, lfs_token, repository_http_path) } - - before do - expect(api).to receive(:lfs_authenticate).with(actor, repo_name).and_return(gitlab_lfs_authentication) - end - - it 'puts payload to stdout' do - expect($stdout).to receive(:puts).with('{"header":{"Authorization":"Basic dGVzdHVzZXI6MTIzNA=="},"href":"/tmp/gitlab-ci.git/info/lfs/"}') - expect(subject.execute(nil, nil)).to be_truthy - end - end - end -end |