summaryrefslogtreecommitdiff
path: root/spec/gitlab_net_spec.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-30 13:37:09 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-09-06 12:11:17 -0500
commitf53d09e1eb1323be9cd697813a6f47375c091f6a (patch)
tree42b1950e5a8f0a7d3f97cf37e1c279793fc7c30d /spec/gitlab_net_spec.rb
parentc16f7323bad61601df1ebe93475bd84aee532faf (diff)
downloadgitlab-shell-f53d09e1eb1323be9cd697813a6f47375c091f6a.tar.gz
Refactored LFS auth logic to use its own API endpoint.
Diffstat (limited to 'spec/gitlab_net_spec.rb')
-rw-r--r--spec/gitlab_net_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/gitlab_net_spec.rb b/spec/gitlab_net_spec.rb
index cee5b91..3d38231 100644
--- a/spec/gitlab_net_spec.rb
+++ b/spec/gitlab_net_spec.rb
@@ -38,7 +38,6 @@ describe GitlabNet, vcr: true do
VCR.use_cassette("discover-ok") do
user = gitlab_net.discover('key-126')
user['name'].should == 'Dmitriy Zaporozhets'
- user['lfs_token'].should == 'wsnys8Zm8Jn7zyhHTAAK'
user['username'].should == 'dzaporozhets'
end
end
@@ -58,6 +57,19 @@ describe GitlabNet, vcr: true do
end
end
+ 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-126', 'gitlab/gitlabhq.git')
+ lfs_access.username.should == 'dzaporozhets'
+ lfs_access.lfs_token.should == 'wsnys8Zm8Jn7zyhHTAAK'
+ lfs_access.repository_http_path.should == 'http://gitlab.dev/gitlab/gitlabhq.git'
+ end
+ end
+ end
+ end
+
describe :broadcast_message do
context "broadcast message exists" do
it 'should return message' do
@@ -132,7 +144,6 @@ describe GitlabNet, vcr: true do
VCR.use_cassette("allowed-pull") do
access = gitlab_net.check_access('git-receive-pack', 'gitlab/gitlabhq.git', 'key-126', changes, 'ssh')
access.allowed?.should be_true
- access.repository_http_path.should == 'http://gitlab.dev/gitlab/gitlabhq.git'
end
end