summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 15:09:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 15:09:36 +0000
commit074d013e1eb3f6e0c27f96a3be8b9361254c8a98 (patch)
treef185c474ddc8624a4793c84b0b1f4cc07349694b /spec/workers
parent8f9beefac3774b30e911fb00a68f4c7a5244cf27 (diff)
downloadgitlab-ce-074d013e1eb3f6e0c27f96a3be8b9361254c8a98.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/namespaces/root_statistics_worker_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/workers/namespaces/root_statistics_worker_spec.rb b/spec/workers/namespaces/root_statistics_worker_spec.rb
index 45e75c9b0da..910a5b23e17 100644
--- a/spec/workers/namespaces/root_statistics_worker_spec.rb
+++ b/spec/workers/namespaces/root_statistics_worker_spec.rb
@@ -74,4 +74,19 @@ describe Namespaces::RootStatisticsWorker, '#perform' do
worker.perform(group.id)
end
end
+
+ it_behaves_like 'an idempotent worker' do
+ let(:job_args) { [group.id] }
+
+ it 'deletes one aggregation schedule' do
+ # Make sure the group and it's aggregation schedule are created before
+ # counting
+ group
+
+ expect { worker.perform(*job_args) }
+ .to change { Namespace::AggregationSchedule.count }.by(-1)
+ expect { worker.perform(*job_args) }
+ .not_to change { Namespace::AggregationSchedule.count }
+ end
+ end
end