summaryrefslogtreecommitdiff
path: root/spec/models/repository_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/repository_spec.rb')
-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