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
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-01 17:25:10 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-01 17:25:10 +0300
commit06b7907c2afe0cb0fa25f4cdef0ff470710de2f9 (patch)
tree18a11195038b46f15671eee254e88664fb5a36d6 /spec
parent30e28a7e0c458395b7a205e72a89e7d1b68571eb (diff)
Fix deploy keys permission check in internal api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git_access_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index 1addba55787..66e87e57cbc 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -46,6 +46,25 @@ describe Gitlab::GitAccess do
it { subject.allowed?.should be_false }
end
end
+
+ describe 'deploy key permissions' do
+ let(:key) { create(:deploy_key) }
+
+ context 'pull code' do
+ context 'allowed' do
+ before { key.projects << project }
+ subject { access.download_access_check(key, project) }
+
+ it { subject.allowed?.should be_true }
+ end
+
+ context 'denied' do
+ subject { access.download_access_check(key, project) }
+
+ it { subject.allowed?.should be_false }
+ end
+ end
+ end
end
describe 'push_access_check' do