summaryrefslogtreecommitdiff
path: root/spec/gitlab_access_spec.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-07-30 10:58:31 +0200
committerJames Lopez <james@jameslopez.es>2018-08-01 07:51:04 +0200
commit4304099c3fee2382aa10a0edb57d932779b83cc9 (patch)
tree0f70d52fcad9dfedfb1ece3334e6d4a5d682f185 /spec/gitlab_access_spec.rb
parente3fead94b6f71d3501d586cbb2295ea0d1da2b31 (diff)
downloadgitlab-shell-4304099c3fee2382aa10a0edb57d932779b83cc9.tar.gz
Add Git protocol v2
Diffstat (limited to 'spec/gitlab_access_spec.rb')
-rw-r--r--spec/gitlab_access_spec.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/gitlab_access_spec.rb b/spec/gitlab_access_spec.rb
index d082176..f9717a7 100644
--- a/spec/gitlab_access_spec.rb
+++ b/spec/gitlab_access_spec.rb
@@ -3,8 +3,8 @@ require 'gitlab_access'
describe GitlabAccess do
let(:repository_path) { "/home/git/repositories" }
- let(:repo_name) { 'dzaporozhets/gitlab-ci' }
- let(:repo_path) { File.join(repository_path, repo_name) + ".git" }
+ let(:repo_name) { 'dzaporozhets/gitlab-ci' }
+ let(:repo_path) { File.join(repository_path, repo_name) + ".git" }
let(:api) do
double(GitlabNet).tap do |api|
api.stub(check_access: GitAccessStatus.new(true,
@@ -13,7 +13,8 @@ describe GitlabAccess do
gl_id: 'user-123',
gl_username: 'testuser',
repository_path: '/home/git/repositories',
- gitaly: nil))
+ gitaly: nil,
+ git_protocol: 'version=2'))
end
end
subject do
@@ -35,14 +36,12 @@ describe GitlabAccess do
describe "#exec" do
context "access is granted" do
-
it "returns true" do
expect(subject.exec).to be_truthy
end
end
context "access is denied" do
-
before do
api.stub(check_access: GitAccessStatus.new(
false,
@@ -51,7 +50,8 @@ describe GitlabAccess do
gl_id: nil,
gl_username: nil,
repository_path: nil,
- gitaly: nil
+ gitaly: nil,
+ git_protocol: nil
))
end
@@ -61,7 +61,6 @@ describe GitlabAccess do
end
context "API connection fails" do
-
before do
api.stub(:check_access).and_raise(GitlabNet::ApiUnreachableError)
end