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:
authorStan Hu <stanhu@gmail.com>2017-12-11 10:41:28 +0300
committerStan Hu <stanhu@gmail.com>2017-12-11 10:41:28 +0300
commitf1eaab7bf1f2ee14a66682c2e53f4e0700fc8243 (patch)
treeb3423bb2ef7a91f0b43a6887cf3e116fbe133f24 /spec/lib/gitlab/bare_repository_import
parent86661a3a0be3ef3a3aa7780705c84ee3f37e5b0e (diff)
Remove the need for destroy and add a comment in the spec
Diffstat (limited to 'spec/lib/gitlab/bare_repository_import')
-rw-r--r--spec/lib/gitlab/bare_repository_import/importer_spec.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/lib/gitlab/bare_repository_import/importer_spec.rb b/spec/lib/gitlab/bare_repository_import/importer_spec.rb
index cce491fa10e..8a83e446935 100644
--- a/spec/lib/gitlab/bare_repository_import/importer_spec.rb
+++ b/spec/lib/gitlab/bare_repository_import/importer_spec.rb
@@ -134,12 +134,11 @@ describe Gitlab::BareRepositoryImport::Importer, repository: true do
end
it 'moves an existing project to the correct path' do
- # This is a quick way to get a valid repository instead of copying an existing one
+ # This is a quick way to get a valid repository instead of copying an
+ # existing one. Since it's not persisted, the importer will try to
+ # create the project.
project = build(:project, :repository)
original_commit_count = project.repository.commit_count
- # We need to destroy the model but keep the repository so that the
- # importer will attempt to load the repository
- project.destroy
bare_repo = Gitlab::BareRepositoryImport::Repository.new(project.repository_storage_path, project.repository.path)
gitlab_importer = described_class.new(admin, bare_repo)