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:
Diffstat (limited to 'spec/workers/repository_update_remote_mirror_worker_spec.rb')
-rw-r--r--spec/workers/repository_update_remote_mirror_worker_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/workers/repository_update_remote_mirror_worker_spec.rb b/spec/workers/repository_update_remote_mirror_worker_spec.rb
index 858f5226c48..ef6a8d76d2c 100644
--- a/spec/workers/repository_update_remote_mirror_worker_spec.rb
+++ b/spec/workers/repository_update_remote_mirror_worker_spec.rb
@@ -3,9 +3,8 @@
require 'spec_helper'
RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_state do
- subject { described_class.new }
+ let_it_be(:remote_mirror) { create(:remote_mirror) }
- let(:remote_mirror) { create(:remote_mirror) }
let(:scheduled_time) { Time.current - 5.minutes }
around do |example|
@@ -19,6 +18,8 @@ RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_st
end
describe '#perform' do
+ subject { described_class.new }
+
it 'calls out to the service to perform the update' do
expect_mirror_service_to_return(remote_mirror, status: :success)
@@ -68,4 +69,8 @@ RSpec.describe RepositoryUpdateRemoteMirrorWorker, :clean_gitlab_redis_shared_st
subject.perform(remote_mirror.id, scheduled_time)
end
end
+
+ include_examples 'an idempotent worker' do
+ let(:job_args) { [remote_mirror.id, scheduled_time] }
+ end
end