diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 15:06:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 15:06:12 +0000 |
commit | 4f4dcd3c5d7a15b7eab5fa28e27482fa68c750a3 (patch) | |
tree | 75e1d73289b774a909461007406eb22b33989265 /spec/lib/gitlab/git | |
parent | 2cf5eb1498d6613523b39a829eb00f76df17e781 (diff) | |
download | gitlab-ce-4f4dcd3c5d7a15b7eab5fa28e27482fa68c750a3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index dcb7401b695..354260f23f6 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -2236,4 +2236,33 @@ describe Gitlab::Git::Repository, :seed_helper do expect(repository.commit(new_commit.oid).id).to eq(new_commit.oid) end end + + describe '#rename' do + let(:project) { create(:project, :repository)} + let(:repository) { project.repository } + + it 'moves the repository' do + checksum = repository.checksum + new_relative_path = "rename_test/relative/path" + renamed_repository = Gitlab::Git::Repository.new(repository.storage, new_relative_path, nil, nil) + + repository.rename(new_relative_path) + + expect(renamed_repository.checksum).to eq(checksum) + expect(repository.exists?).to be false + end + end + + describe '#remove' do + let(:project) { create(:project, :repository)} + let(:repository) { project.repository } + + it 'removes the repository' do + expect(repository.exists?).to be true + + repository.remove + + expect(repository.raw_repository.exists?).to be false + end + end end |