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>2016-10-29 00:36:40 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-29 00:36:40 +0300
commitb7d3fc15a45a7f3ca0a293a23edf7e74ad80aa78 (patch)
treec6c540ad4f32f5269caa3de512d0670b7929d92d /spec
parentc8ad9fec22d28d23b9b26c3d11b202ae28b70905 (diff)
parent440604ad1ba67dcbdd23633765b9140fae4bd4b9 (diff)
Merge branch 'dz-internal-api-fullpath' into 'master'
Make internal api work with full repo path and name ## What does this MR do? Make internal api work with full repo path and name ## Why was this MR needed? So we can pass full repository path on filesystem from gitlab-shell instead of extracted one. We need this for nested groups support where project is can be nested under several groups. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/2772 See merge request !7148
Diffstat (limited to 'spec')
-rw-r--r--spec/models/repository_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 187a1bf2d79..b8204e1bf03 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -1472,4 +1472,14 @@ describe Repository, models: true do
end.to raise_error(Repository::CommitError)
end
end
+
+ describe '#remove_storage_from_path' do
+ let(:storage_path) { project.repository_storage_path }
+ let(:project_path) { project.path_with_namespace }
+ let(:full_path) { File.join(storage_path, project_path) }
+
+ it { expect(Repository.remove_storage_from_path(full_path)).to eq(project_path) }
+ it { expect(Repository.remove_storage_from_path(project_path)).to eq(project_path) }
+ it { expect(Repository.remove_storage_from_path(storage_path)).to eq('') }
+ end
end