summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/workers/git_garbage_collect_worker_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/workers/git_garbage_collect_worker_spec.rb b/spec/workers/git_garbage_collect_worker_spec.rb
new file mode 100644
index 00000000000..3df64c35166
--- /dev/null
+++ b/spec/workers/git_garbage_collect_worker_spec.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+require 'fileutils'
+
+require 'spec_helper'
+
+RSpec.describe GitGarbageCollectWorker do
+ let_it_be(:project) { create(:project, :repository) }
+
+ let(:lease_uuid) { SecureRandom.uuid }
+ let(:lease_key) { "project_housekeeping:#{project.id}" }
+ let(:task) { :full_repack }
+ let(:params) { [project.id, task, lease_key, lease_uuid] }
+
+ subject { described_class.new }
+
+ describe "#perform" do
+ it 'calls the Projects::GitGarbageGitGarbageCollectWorker with the same params' do
+ expect_next_instance_of(Projects::GitGarbageCollectWorker) do |instance|
+ expect(instance).to receive(:perform).with(*params)
+ end
+
+ subject.perform(*params)
+ end
+ end
+end