diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:19 +0000 |
commit | e6baeabaa9651d90b03bb64ffce75a2c3cb89aab (patch) | |
tree | 85f3cbd6e437b17be59505cf3ac4794c1838609e /spec/lib/gitlab/import_export | |
parent | 5064bf8c5647d4c4430cbb4d097cf1592416de29 (diff) | |
download | gitlab-ce-e6baeabaa9651d90b03bb64ffce75a2c3cb89aab.tar.gz |
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.rb | 13 |
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 |