Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-26 11:05:32 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-31 16:24:19 +0300
commitd7afed34c4238d637ce71fe8dbea41a64e7a3f1f (patch)
tree840e797c7f5bbe789fa0a490e124c232b1972ffc /spec/lib
parent5035250337427baa1f6462ee4b1c004f529d765c (diff)
Remove feature flags from lib/backup
Moved to OPT_OUT in 7d14b725a0da41d1ae7c0a8496b5e66832023e3b, Now, by removing the feature gates, this is an mandatory feature. Related issues: - https://gitlab.com/gitlab-org/gitaly/issues/526 - https://gitlab.com/gitlab-org/gitaly/issues/1194 Closes https://gitlab.com/gitlab-org/gitaly/issues/749 Closes https://gitlab.com/gitlab-org/gitaly/issues/1212 Closes https://gitlab.com/gitlab-org/gitaly/issues/1195
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/backup/repository_spec.rb40
-rw-r--r--spec/lib/gitlab/gitaly_client/storage_service_spec.rb13
2 files changed, 28 insertions, 25 deletions
diff --git a/spec/lib/backup/repository_spec.rb b/spec/lib/backup/repository_spec.rb
index 92a27e308d2..c5a854b5660 100644
--- a/spec/lib/backup/repository_spec.rb
+++ b/spec/lib/backup/repository_spec.rb
@@ -73,37 +73,27 @@ describe Backup::Repository do
end
end
- describe '#delete_all_repositories', :seed_helper do
- shared_examples('delete_all_repositories') do
- before do
- allow(FileUtils).to receive(:mkdir_p).and_call_original
- allow(FileUtils).to receive(:mv).and_call_original
- end
-
- after(:all) do
- ensure_seeds
- end
-
- it 'removes all repositories' do
- # Sanity check: there should be something for us to delete
- expect(list_repositories).to include(File.join(SEED_STORAGE_PATH, TEST_REPO_PATH))
+ describe '#prepare_directories', :seed_helper do
+ before do
+ allow(FileUtils).to receive(:mkdir_p).and_call_original
+ allow(FileUtils).to receive(:mv).and_call_original
+ end
- subject.delete_all_repositories('default', Gitlab.config.repositories.storages['default'])
+ after(:all) do
+ ensure_seeds
+ end
- expect(list_repositories).to be_empty
- end
+ it' removes all repositories' do
+ # Sanity check: there should be something for us to delete
+ expect(list_repositories).to include(File.join(SEED_STORAGE_PATH, TEST_REPO_PATH))
- def list_repositories
- Dir[File.join(SEED_STORAGE_PATH, '*.git')]
- end
- end
+ subject.prepare_directories
- context 'with gitaly' do
- it_behaves_like 'delete_all_repositories'
+ expect(list_repositories).to be_empty
end
- context 'without gitaly', :skip_gitaly_mock do
- it_behaves_like 'delete_all_repositories'
+ def list_repositories
+ Dir[File.join(SEED_STORAGE_PATH, '*.git')]
end
end
diff --git a/spec/lib/gitlab/gitaly_client/storage_service_spec.rb b/spec/lib/gitlab/gitaly_client/storage_service_spec.rb
new file mode 100644
index 00000000000..6c25e2d6ebd
--- /dev/null
+++ b/spec/lib/gitlab/gitaly_client/storage_service_spec.rb
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe Gitlab::GitalyClient::StorageService do
+ describe '#delete_all_repositories' do
+ let!(:project) { create(:project, :repository) }
+
+ it 'removes all repositories' do
+ described_class.new(project.repository_storage).delete_all_repositories
+
+ expect(project.repository.exists?).to be(false)
+ end
+ end
+end