Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-05-16 19:08:23 +0300
committerMichael Kozono <mkozono@gmail.com>2017-06-05 15:32:26 +0300
commitb387429458f77a3608e077dfe2d50b0a313f8832 (patch)
treede72b31ed0607eef7516dfc99c865e8050567120
parenta738a446f4ade6204c10f016e355da354dbfc01f (diff)
Refactor
-rw-r--r--app/controllers/projects/git_http_client_controller.rb4
-rw-r--r--spec/lib/gitlab/git_access_spec.rb12
2 files changed, 6 insertions, 10 deletions
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb
index 9a1bf037a95..44b0853e3e9 100644
--- a/app/controllers/projects/git_http_client_controller.rb
+++ b/app/controllers/projects/git_http_client_controller.rb
@@ -152,8 +152,4 @@ class Projects::GitHttpClientController < Projects::ApplicationController
def has_authentication_ability?(capability)
(authentication_abilities || []).include?(capability)
end
-
- def authentication_project
- authentication_result.project
- end
end
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index a86afe57873..1033fef9684 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -23,30 +23,30 @@ describe Gitlab::GitAccess, lib: true do
context 'ssh disabled' do
before do
disable_protocol('ssh')
- @acc = Gitlab::GitAccess.new(actor, project, 'ssh', authentication_abilities: authentication_abilities)
end
it 'blocks ssh git push' do
- expect(@acc.check('git-receive-pack', '_any').allowed?).to be_falsey
+ expect(access.check('git-receive-pack', '_any').allowed?).to be_falsey
end
it 'blocks ssh git pull' do
- expect(@acc.check('git-upload-pack', '_any').allowed?).to be_falsey
+ expect(access.check('git-upload-pack', '_any').allowed?).to be_falsey
end
end
context 'http disabled' do
+ let(:protocol) { 'http' }
+
before do
disable_protocol('http')
- @acc = Gitlab::GitAccess.new(actor, project, 'http', authentication_abilities: authentication_abilities)
end
it 'blocks http push' do
- expect(@acc.check('git-receive-pack', '_any').allowed?).to be_falsey
+ expect(access.check('git-receive-pack', '_any').allowed?).to be_falsey
end
it 'blocks http git pull' do
- expect(@acc.check('git-upload-pack', '_any').allowed?).to be_falsey
+ expect(access.check('git-upload-pack', '_any').allowed?).to be_falsey
end
end
end