summaryrefslogtreecommitdiff
path: root/spec/migrations/remove_alerts_service_records_again_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 10:34:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 10:34:06 +0000
commit859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch)
treed7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/migrations/remove_alerts_service_records_again_spec.rb
parent446d496a6d000c73a304be52587cd9bbc7493136 (diff)
downloadgitlab-ce-859a6fb938bb9ee2a317c46dfa4fcc1af49608f0.tar.gz
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/migrations/remove_alerts_service_records_again_spec.rb')
-rw-r--r--spec/migrations/remove_alerts_service_records_again_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/migrations/remove_alerts_service_records_again_spec.rb b/spec/migrations/remove_alerts_service_records_again_spec.rb
new file mode 100644
index 00000000000..963b54848f9
--- /dev/null
+++ b/spec/migrations/remove_alerts_service_records_again_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require Rails.root.join('db', 'post_migrate', '20210205214003_remove_alerts_service_records_again.rb')
+
+RSpec.describe RemoveAlertsServiceRecordsAgain do
+ let(:services) { table(:services) }
+
+ before do
+ 5.times { services.create!(type: 'AlertsService') }
+ services.create!(type: 'SomeOtherType')
+ end
+
+ it 'removes services records of type AlertsService and corresponding data', :aggregate_failures do
+ expect(services.count).to eq(6)
+
+ migrate!
+
+ expect(services.count).to eq(1)
+ expect(services.first.type).to eq('SomeOtherType')
+ expect(services.where(type: 'AlertsService')).to be_empty
+ end
+end