diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-10-10 12:09:49 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-10-10 12:13:00 +0300 |
commit | 5b32a4aaffc54c7ea9aca9e2745fcbcdbeae7a22 (patch) | |
tree | 5e3b10e9a46ccf7b2256c24c9c7782565b953847 /spec/workers/repository_import_worker_spec.rb | |
parent | 43b692cb4b43a476862fb6e7bf4c09edd6035077 (diff) |
Backports EE 38771 changes to CE.
Diffstat (limited to 'spec/workers/repository_import_worker_spec.rb')
-rw-r--r-- | spec/workers/repository_import_worker_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/workers/repository_import_worker_spec.rb b/spec/workers/repository_import_worker_spec.rb index 100dfc32bbe..5cff5108477 100644 --- a/spec/workers/repository_import_worker_spec.rb +++ b/spec/workers/repository_import_worker_spec.rb @@ -6,6 +6,23 @@ describe RepositoryImportWorker do subject { described_class.new } describe '#perform' do + context 'when worker was reset without cleanup' do + let(:jid) { '12345678' } + let(:started_project) { create(:project, :import_started, import_jid: jid) } + + it 'imports the project successfully' do + allow(subject).to receive(:jid).and_return(jid) + + expect_any_instance_of(Projects::ImportService).to receive(:execute) + .and_return({ status: :ok }) + + expect_any_instance_of(Repository).to receive(:expire_emptiness_caches) + expect_any_instance_of(Project).to receive(:import_finish) + + subject.perform(project.id) + end + end + context 'when the import was successful' do it 'imports a project' do expect_any_instance_of(Projects::ImportService).to receive(:execute) |