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:
authorJames Lopez <james@gitlab.com>2017-04-04 19:34:19 +0300
committerRémy Coutable <remy@rymai.me>2017-04-04 19:34:19 +0300
commit22d7ae80020e3d581d7bded2c2f3d5606a5e48ee (patch)
treea57e4669b88241baf8389f1a3faa4b057a1b4293 /spec/lib/gitlab/import_export/repo_saver_spec.rb
parent82836af4e7bda539d03ceee8238f863268b2a46e (diff)
Fix issues importing forked projects
Diffstat (limited to 'spec/lib/gitlab/import_export/repo_saver_spec.rb')
-rw-r--r--spec/lib/gitlab/import_export/repo_saver_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/repo_saver_spec.rb b/spec/lib/gitlab/import_export/repo_saver_spec.rb
new file mode 100644
index 00000000000..a7f4e11271e
--- /dev/null
+++ b/spec/lib/gitlab/import_export/repo_saver_spec.rb
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe Gitlab::ImportExport::RepoSaver, services: true do
+ describe 'bundle a project Git repo' do
+ let(:user) { create(:user) }
+ let!(:project) { create(:empty_project, :public, name: 'searchable_project') }
+ let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" }
+ let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.path_with_namespace) }
+ let(:bundler) { described_class.new(project: project, shared: shared) }
+
+ before do
+ project.team << [user, :master]
+ allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
+ end
+
+ after do
+ FileUtils.rm_rf(export_path)
+ end
+
+ it 'bundles the repo successfully' do
+ expect(bundler.save).to be true
+ end
+ end
+end