Remove the need for destroy and add a comment in the spec
This commit is contained in:
parent
86661a3a0b
commit
f1eaab7bf1
1 changed files with 3 additions and 4 deletions
|
@ -134,12 +134,11 @@ describe Gitlab::BareRepositoryImport::Importer, repository: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'moves an existing project to the correct path' do
|
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)
|
project = build(:project, :repository)
|
||||||
original_commit_count = project.repository.commit_count
|
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)
|
bare_repo = Gitlab::BareRepositoryImport::Repository.new(project.repository_storage_path, project.repository.path)
|
||||||
gitlab_importer = described_class.new(admin, bare_repo)
|
gitlab_importer = described_class.new(admin, bare_repo)
|
||||||
|
|
Loading…
Reference in a new issue