diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-01 00:13:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-01 00:13:35 +0300 |
commit | 86ad1426d8a8f5d7f20bc5d8b536d3034d829d1f (patch) | |
tree | 7159021dd6fd3834a21096901bddb3b1915caa23 /spec/migrations/20230125195503_queue_backfill_compliance_violations_spec.rb | |
parent | 36eff6e5089629619cc55f4771fa949d6ae2b29b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations/20230125195503_queue_backfill_compliance_violations_spec.rb')
-rw-r--r-- | spec/migrations/20230125195503_queue_backfill_compliance_violations_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/migrations/20230125195503_queue_backfill_compliance_violations_spec.rb b/spec/migrations/20230125195503_queue_backfill_compliance_violations_spec.rb new file mode 100644 index 00000000000..a70f9820855 --- /dev/null +++ b/spec/migrations/20230125195503_queue_backfill_compliance_violations_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe QueueBackfillComplianceViolations, feature_category: :compliance_management do + let(:migration) { described_class::MIGRATION } + + describe '#up' do + it 'schedules background jobs for each batch of merge_request_compliance_violations' do + migrate! + + expect(migration).to( + have_scheduled_batched_migration( + table_name: :merge_requests_compliance_violations, + column_name: :id, + interval: described_class::INTERVAL, + batch_size: described_class::BATCH_SIZE + ) + ) + end + end + + describe '#down' do + it 'deletes all batched migration records' do + migrate! + schema_migrate_down! + + expect(migration).not_to have_scheduled_batched_migration + end + end +end |