diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-29 00:09:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-29 00:09:36 +0300 |
commit | e5940143fe1fdb95ed7c3dc6f0a4efdfaaf876c0 (patch) | |
tree | 006afb964e1f39ccc5429d8cc91793f6cab4ddf4 /spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb | |
parent | 953180403c1798ba42d396742e0691d5772da3a5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb')
-rw-r--r-- | spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb index 6292f0246f7..aa2a3329477 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb @@ -126,13 +126,16 @@ RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProject let(:project) { create(:project, :repository, :legacy_storage, path: 'the-path', namespace: known_parent) } it 'moves the repository for a project' do - expected_path = Gitlab::GitalyClient::StorageSettings.allow_disk_access do - File.join(TestEnv.repos_path, 'known-parent', 'new-repo.git') - end + expected_repository = Gitlab::Git::Repository.new( + project.repository_storage, + 'known-parent/new-repo.git', + nil, + nil + ) subject.move_repository(project, 'known-parent/the-path', 'known-parent/new-repo') - expect(File.directory?(expected_path)).to be(true) + expect(expected_repository).to exist end end @@ -157,9 +160,12 @@ RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProject project.create_repository subject.rename_project(project) - expected_path = Gitlab::GitalyClient::StorageSettings.allow_disk_access do - File.join(TestEnv.repos_path, 'known-parent', 'the-path.git') - end + expected_repository = Gitlab::Git::Repository.new( + project.repository_storage, + 'known-parent/the-path.git', + nil, + nil + ) expect(subject).to receive(:move_project_folders) .with( @@ -170,7 +176,7 @@ RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProject subject.revert_renames - expect(File.directory?(expected_path)).to be_truthy + expect(expected_repository).to exist end it "doesn't break when the project was renamed" do |