diff options
author | Nick Thomas <nick@gitlab.com> | 2017-12-01 13:58:49 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-02-07 13:40:46 +0000 |
commit | 6b0c6e69e1b249f14624550fcbca7f5ee6f51410 (patch) | |
tree | 0a724fbb80c728e64a4b445f1a798f035502dd9a /spec/services | |
parent | ead97c55eac773444dee547a934112aa282c2e2e (diff) | |
download | gitlab-ce-6b0c6e69e1b249f14624550fcbca7f5ee6f51410.tar.gz |
Use hashed storage in the specs40744-hashed-storage-specs
Diffstat (limited to 'spec/services')
7 files changed, 12 insertions, 10 deletions
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb index ac4b9c02ba7..e8216abb08b 100644 --- a/spec/services/groups/destroy_service_spec.rb +++ b/spec/services/groups/destroy_service_spec.rb @@ -6,7 +6,7 @@ describe Groups::DestroyService do let!(:user) { create(:user) } let!(:group) { create(:group) } let!(:nested_group) { create(:group, parent: group) } - let!(:project) { create(:project, namespace: group) } + let!(:project) { create(:project, :legacy_storage, namespace: group) } let!(:notification_setting) { create(:notification_setting, source: group)} let(:gitlab_shell) { Gitlab::Shell.new } let(:remove_path) { group.path + "+#{group.id}+deleted" } @@ -141,7 +141,7 @@ describe Groups::DestroyService do end context 'legacy storage' do - let!(:project) { create(:project, :empty_repo, namespace: group) } + let!(:project) { create(:project, :legacy_storage, :empty_repo, namespace: group) } it 'removes repository' do expect(gitlab_shell.exists?(project.repository_storage_path, "#{project.disk_path}.git")).to be_falsey @@ -149,7 +149,7 @@ describe Groups::DestroyService do end context 'hashed storage' do - let!(:project) { create(:project, :hashed, :empty_repo, namespace: group) } + let!(:project) { create(:project, :empty_repo, namespace: group) } it 'removes repository' do expect(gitlab_shell.exists?(project.repository_storage_path, "#{project.disk_path}.git")).to be_falsey diff --git a/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb b/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb index 15699574b3a..fb6d7171ac3 100644 --- a/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb +++ b/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::HashedStorage::MigrateAttachmentsService do subject(:service) { described_class.new(project) } - let(:project) { create(:project) } + let(:project) { create(:project, :legacy_storage) } let(:legacy_storage) { Storage::LegacyProject.new(project) } let(:hashed_storage) { Storage::HashedProject.new(project) } diff --git a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb index 7b536cc05cb..747bd4529a0 100644 --- a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb +++ b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::HashedStorage::MigrateRepositoryService do let(:gitlab_shell) { Gitlab::Shell.new } - let(:project) { create(:project, :repository, :wiki_repo) } + let(:project) { create(:project, :legacy_storage, :repository, :wiki_repo) } let(:service) { described_class.new(project) } let(:legacy_storage) { Storage::LegacyProject.new(project) } let(:hashed_storage) { Storage::HashedProject.new(project) } diff --git a/spec/services/projects/hashed_storage_migration_service_spec.rb b/spec/services/projects/hashed_storage_migration_service_spec.rb index 466f0b5d7c2..e8e18bb3ac0 100644 --- a/spec/services/projects/hashed_storage_migration_service_spec.rb +++ b/spec/services/projects/hashed_storage_migration_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::HashedStorageMigrationService do - let(:project) { create(:project, :empty_repo, :wiki_repo) } + let(:project) { create(:project, :empty_repo, :wiki_repo, :legacy_storage) } subject(:service) { described_class.new(project) } describe '#execute' do diff --git a/spec/services/projects/transfer_service_spec.rb b/spec/services/projects/transfer_service_spec.rb index ef68742a463..ae0e22e3dc0 100644 --- a/spec/services/projects/transfer_service_spec.rb +++ b/spec/services/projects/transfer_service_spec.rb @@ -4,7 +4,7 @@ describe Projects::TransferService do let(:gitlab_shell) { Gitlab::Shell.new } let(:user) { create(:user) } let(:group) { create(:group) } - let(:project) { create(:project, :repository, namespace: user.namespace) } + let(:project) { create(:project, :repository, :legacy_storage, namespace: user.namespace) } context 'namespace -> namespace' do before do @@ -214,7 +214,7 @@ describe Projects::TransferService do end context 'when hashed storage in use' do - let(:hashed_project) { create(:project, :repository, :hashed, namespace: user.namespace) } + let(:hashed_project) { create(:project, :repository, namespace: user.namespace) } before do group.add_owner(user) diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index fc6aa713d6f..a0b97ceead9 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -150,6 +150,8 @@ describe Projects::UpdateService do let(:repository_storage_path) { Gitlab.config.repositories.storages[repository_storage]['path'] } context 'with legacy storage' do + let(:project) { create(:project, :legacy_storage, :repository, creator: user, namespace: user.namespace) } + before do gitlab_shell.add_repository(repository_storage, "#{user.namespace.full_path}/existing") end diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb index bb3d73edf8e..11c75ddfcf8 100644 --- a/spec/services/users/destroy_service_spec.rb +++ b/spec/services/users/destroy_service_spec.rb @@ -173,7 +173,7 @@ describe Users::DestroyService do end context 'legacy storage' do - let!(:project) { create(:project, :empty_repo, namespace: user.namespace) } + let!(:project) { create(:project, :empty_repo, :legacy_storage, namespace: user.namespace) } it 'removes repository' do expect(gitlab_shell.exists?(project.repository_storage_path, "#{project.disk_path}.git")).to be_falsey @@ -181,7 +181,7 @@ describe Users::DestroyService do end context 'hashed storage' do - let!(:project) { create(:project, :empty_repo, :hashed, namespace: user.namespace) } + let!(:project) { create(:project, :empty_repo, namespace: user.namespace) } it 'removes repository' do expect(gitlab_shell.exists?(project.repository_storage_path, "#{project.disk_path}.git")).to be_falsey |