summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/git_access_spec.rb
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-04-05 12:22:34 -0500
committerMayra Cabrera <mcabrera@gitlab.com>2018-04-06 21:20:16 -0500
commit8315861c9a50675b4f4f4ca536f0da90f27994f3 (patch)
treeb5f25e5dbd74621ef77d480ba69f4f21d5c00d7d /spec/lib/gitlab/git_access_spec.rb
parent72220a99d1cdbcf8a914f9e765c43e63eaee2548 (diff)
downloadgitlab-ce-8315861c9a50675b4f4f4ca536f0da90f27994f3.tar.gz
Include ProjectDeployTokens
Also: - Changes scopes from serializer to use boolean columns - Fixes broken specs
Diffstat (limited to 'spec/lib/gitlab/git_access_spec.rb')
-rw-r--r--spec/lib/gitlab/git_access_spec.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index 928825c21fa..000e9e86813 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -147,25 +147,17 @@ describe Gitlab::GitAccess do
end
context 'when actor is DeployToken' do
- context 'when DeployToken is active and belongs to project' do
- let(:actor) { create(:deploy_token, :read_repo, project: project) }
+ let(:project_deploy_token) { create(:project_deploy_token, project: project) }
+ let(:actor) { project_deploy_token.deploy_token }
+ context 'when DeployToken is active and belongs to project' do
it 'allows pull access' do
expect { pull_access_check }.not_to raise_error
end
end
- context 'when DeployToken has been revoked' do
- let(:actor) { create(:deploy_token, :read_repo, project: project) }
-
- it 'blocks pull access' do
- actor.revoke!
- expect { pull_access_check }.to raise_not_found
- end
- end
-
context 'when DeployToken does not belong to project' do
- let(:actor) { create(:deploy_token, :read_repo) }
+ let(:actor) { create(:deploy_token) }
it 'blocks pull access' do
expect { pull_access_check }.to raise_not_found