diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-04-18 16:27:11 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-01 11:14:24 +0200 |
commit | e50f4bc066e4477e9c59708f978383b071dc2959 (patch) | |
tree | 01a5380078da222c87b6ed91012b7274c74cc20d /spec/models/namespace_spec.rb | |
parent | ab5f9027fb2a78f9c15b3f4d0fcd20ed998e5272 (diff) | |
download | gitlab-ce-e50f4bc066e4477e9c59708f978383b071dc2959.tar.gz |
The dynamic path validator can block out partial paths
So we can block `objects` only when it is contained in `info/lfs` or `gitlab-lfs`
Diffstat (limited to 'spec/models/namespace_spec.rb')
-rw-r--r-- | spec/models/namespace_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 6775fd2f1b8..8624616316c 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -34,6 +34,13 @@ describe Namespace, models: true do let(:group) { build(:group, :nested, path: 'tree') } it { expect(group).not_to be_valid } + + it 'rejects nested paths' do + parent = create(:group, :nested, path: 'environments') + namespace = build(:project, path: 'folders', namespace: parent) + + expect(namespace).not_to be_valid + end end context 'top-level group' do |