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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-25 15:08:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-25 15:08:19 +0300
commite6baeabaa9651d90b03bb64ffce75a2c3cb89aab (patch)
tree85f3cbd6e437b17be59505cf3ac4794c1838609e /spec/lib/gitlab/import_export
parent5064bf8c5647d4c4430cbb4d097cf1592416de29 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/import_export')
-rw-r--r--spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb b/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb
index d72d41ddf38..3ce950d6a64 100644
--- a/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb
@@ -55,9 +55,11 @@ describe Gitlab::ImportExport::SnippetRepoRestorer do
let(:snippet_bundle_path) { File.join(bundle_path, "#{snippet_with_repo.hexdigest}.bundle") }
let(:result) { exporter.save }
- it 'creates the repository from the bundle' do
+ before do
expect(exporter.save).to be_truthy
+ end
+ it 'creates the repository from the bundle' do
expect(snippet.repository_exists?).to be_falsey
expect(snippet.snippet_repository).to be_nil
expect(snippet.repository).to receive(:create_from_bundle).and_call_original
@@ -66,5 +68,14 @@ describe Gitlab::ImportExport::SnippetRepoRestorer do
expect(snippet.repository_exists?).to be_truthy
expect(snippet.snippet_repository).not_to be_nil
end
+
+ it 'sets same shard in snippet repository as in the repository storage' do
+ expect(snippet).to receive(:repository_storage).and_return('picked')
+ expect(snippet.repository).to receive(:create_from_bundle)
+
+ restorer.restore
+
+ expect(snippet.snippet_repository.shard_name).to eq 'picked'
+ end
end
end