diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2019-02-22 11:12:06 +0300 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2019-03-01 17:49:20 +0300 |
commit | 4bae61005dd835c7c8bf3ce911328a8e8af86a93 (patch) | |
tree | 4cd1959d30a37fdae86554bead3032c23c284d4b /spec/services/projects/hashed_storage/migrate_repository_service_spec.rb | |
parent | fc0ff92807620c36d01f23eb0d7d88b02cb141c1 (diff) |
Edge case: upgrade/downgrade when repository doesn't exist
This change takes the case where repository doesn't exist on disk
and make it ignore but succeed the step, increasing or decreasing the
version depending on the operation.
Diffstat (limited to 'spec/services/projects/hashed_storage/migrate_repository_service_spec.rb')
-rw-r--r-- | spec/services/projects/hashed_storage/migrate_repository_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 0772dc4b85b..cd56337420b 100644 --- a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb +++ b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb @@ -32,6 +32,16 @@ describe Projects::HashedStorage::MigrateRepositoryService do end end + context 'when repository doesnt exist on disk' do + let(:project) { create(:project, :legacy_storage) } + + it 'skips the disk change but increase the version' do + service.execute + + expect(project.hashed_storage?(:repository)).to be_truthy + end + end + context 'when succeeds' do it 'renames project and wiki repositories' do service.execute |