diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/lib/gitlab/git_access_project_spec.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/lib/gitlab/git_access_project_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git_access_project_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/lib/gitlab/git_access_project_spec.rb b/spec/lib/gitlab/git_access_project_spec.rb index f80915b2be9..953b74cf1a9 100644 --- a/spec/lib/gitlab/git_access_project_spec.rb +++ b/spec/lib/gitlab/git_access_project_spec.rb @@ -9,6 +9,7 @@ RSpec.describe Gitlab::GitAccessProject do let(:actor) { user } let(:project_path) { project.path } let(:namespace_path) { project&.namespace&.path } + let(:repository_path) { "#{namespace_path}/#{project_path}.git" } let(:protocol) { 'ssh' } let(:authentication_abilities) { %i[read_project download_code push_code] } let(:changes) { Gitlab::GitAccess::ANY } @@ -17,7 +18,7 @@ RSpec.describe Gitlab::GitAccessProject do let(:access) do described_class.new(actor, container, protocol, authentication_abilities: authentication_abilities, - repository_path: project_path, namespace_path: namespace_path) + repository_path: repository_path) end describe '#check_namespace!' do @@ -103,6 +104,20 @@ RSpec.describe Gitlab::GitAccessProject do end end + context 'when namespace is blank' do + let(:repository_path) { 'project.git' } + + it_behaves_like 'no project is created' do + let(:raise_specific_error) { raise_namespace_not_found } + end + end + + context 'when namespace does not exist' do + let(:namespace_path) { 'unknown' } + + it_behaves_like 'no project is created' + end + context 'when user cannot create project in namespace' do let(:user2) { create(:user) } let(:namespace_path) { user2.namespace.path } |