summaryrefslogtreecommitdiff
path: root/spec/migrations/active_record
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/migrations/active_record
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
downloadgitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/migrations/active_record')
-rw-r--r--spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb46
1 files changed, 0 insertions, 46 deletions
diff --git a/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb b/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb
deleted file mode 100644
index e973454ecc8..00000000000
--- a/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require Rails.root.join('db', 'post_migrate', '20180122154930_schedule_set_confidential_note_events_on_services.rb')
-
-describe ScheduleSetConfidentialNoteEventsOnServices do
- let(:services_table) { table(:services) }
- let(:migration_class) { Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnServices }
- let(:migration_name) { migration_class.to_s.demodulize }
-
- let!(:service_1) { services_table.create!(confidential_note_events: nil, note_events: true) }
- let!(:service_2) { services_table.create!(confidential_note_events: nil, note_events: true) }
- let!(:service_migrated) { services_table.create!(confidential_note_events: true, note_events: true) }
- let!(:service_skip) { services_table.create!(confidential_note_events: nil, note_events: false) }
- let!(:service_new) { services_table.create!(confidential_note_events: false, note_events: true) }
- let!(:service_4) { services_table.create!(confidential_note_events: nil, note_events: true) }
-
- before do
- stub_const("#{described_class}::BATCH_SIZE", 1)
- end
-
- it 'schedules background migrations at correct time' do
- Sidekiq::Testing.fake! do
- Timecop.freeze do
- migrate!
-
- expect(migration_name).to be_scheduled_delayed_migration(20.minutes, service_1.id, service_1.id)
- expect(migration_name).to be_scheduled_delayed_migration(40.minutes, service_2.id, service_2.id)
- expect(migration_name).to be_scheduled_delayed_migration(60.minutes, service_4.id, service_4.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq 3
- end
- end
- end
-
- it 'correctly processes services', :sidekiq_might_not_need_inline do
- perform_enqueued_jobs do
- expect(services_table.where(confidential_note_events: nil).count).to eq 4
- expect(services_table.where(confidential_note_events: true).count).to eq 1
-
- migrate!
-
- expect(services_table.where(confidential_note_events: nil).count).to eq 1
- expect(services_table.where(confidential_note_events: true).count).to eq 4
- end
- end
-end