diff options
author | Ali Ibrahim <aliibrahim@gmail.com> | 2016-08-14 13:49:08 -0400 |
---|---|---|
committer | Ali Ibrahim <aliibrahim@gmail.com> | 2016-08-17 11:11:08 -0400 |
commit | 2b73aaa15ad9f651f51f8c71de461da6664a4fbb (patch) | |
tree | 0704849e63b0d396ab367056348c1eb90646b884 /spec | |
parent | d1da2e8180d92e5f4a8b5ebb36b0f4e4d0618bf8 (diff) | |
download | gitlab-ce-2b73aaa15ad9f651f51f8c71de461da6664a4fbb.tar.gz |
Allow to add deploy keys with write-access
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git_access_spec.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index f12c9a370f7..d0e73d70e6e 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -284,19 +284,22 @@ describe Gitlab::GitAccess, lib: true do end describe 'deploy key permissions' do - let(:key) { create(:deploy_key) } - let(:actor) { key } - context 'push code' do subject { access.check('git-receive-pack', '_any') } context 'when project is authorized' do + let(:key) { create(:deploy_key, can_push: true) } + let(:actor) { key } + before { key.projects << project } - it { expect(subject).not_to be_allowed } + it { expect(subject).to be_allowed } end context 'when unauthorized' do + let(:key) { create(:deploy_key, can_push: false) } + let(:actor) { key } + context 'to public project' do let(:project) { create(:project, :public) } |