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:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-10-10 12:09:49 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-10-10 12:13:00 +0300
commit5b32a4aaffc54c7ea9aca9e2745fcbcdbeae7a22 (patch)
tree5e3b10e9a46ccf7b2256c24c9c7782565b953847 /spec/workers/repository_fork_worker_spec.rb
parent43b692cb4b43a476862fb6e7bf4c09edd6035077 (diff)
Backports EE 38771 changes to CE.
Diffstat (limited to 'spec/workers/repository_fork_worker_spec.rb')
-rw-r--r--spec/workers/repository_fork_worker_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/workers/repository_fork_worker_spec.rb b/spec/workers/repository_fork_worker_spec.rb
index d9e9409840f..e881ec37ae5 100644
--- a/spec/workers/repository_fork_worker_spec.rb
+++ b/spec/workers/repository_fork_worker_spec.rb
@@ -12,6 +12,28 @@ describe RepositoryForkWorker do
end
describe "#perform" do
+ describe 'when a worker was reset without cleanup' do
+ let(:jid) { '12345678' }
+ let(:started_project) { create(:project, :repository, :import_started) }
+
+ it 'creates a new repository from a fork' do
+ allow(subject).to receive(:jid).and_return(jid)
+
+ expect(shell).to receive(:fork_repository).with(
+ '/test/path',
+ project.full_path,
+ project.repository_storage_path,
+ fork_project.namespace.full_path
+ ).and_return(true)
+
+ subject.perform(
+ project.id,
+ '/test/path',
+ project.full_path,
+ fork_project.namespace.full_path)
+ end
+ end
+
it "creates a new repository from a fork" do
expect(shell).to receive(:fork_repository).with(
'/test/path',