summaryrefslogtreecommitdiff
path: root/spec/workers/gitlab/import/stuck_project_import_jobs_worker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/gitlab/import/stuck_project_import_jobs_worker_spec.rb')
-rw-r--r--spec/workers/gitlab/import/stuck_project_import_jobs_worker_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/workers/gitlab/import/stuck_project_import_jobs_worker_spec.rb b/spec/workers/gitlab/import/stuck_project_import_jobs_worker_spec.rb
new file mode 100644
index 00000000000..5afc5717b82
--- /dev/null
+++ b/spec/workers/gitlab/import/stuck_project_import_jobs_worker_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Gitlab::Import::StuckProjectImportJobsWorker do
+ let(:worker) { described_class.new }
+
+ describe 'with scheduled import_status' do
+ it_behaves_like 'stuck import job detection' do
+ let(:import_state) { create(:project, :import_scheduled).import_state }
+
+ before do
+ import_state.update(jid: '123')
+ end
+ end
+ end
+
+ describe 'with started import_status' do
+ it_behaves_like 'stuck import job detection' do
+ let(:import_state) { create(:project, :import_started).import_state }
+
+ before do
+ import_state.update(jid: '123')
+ end
+ end
+ end
+end