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/migrations/20230329100222_drop_software_licenses_temp_index_spec.rb')
-rw-r--r--spec/migrations/20230329100222_drop_software_licenses_temp_index_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/migrations/20230329100222_drop_software_licenses_temp_index_spec.rb b/spec/migrations/20230329100222_drop_software_licenses_temp_index_spec.rb
new file mode 100644
index 00000000000..d4d276980f8
--- /dev/null
+++ b/spec/migrations/20230329100222_drop_software_licenses_temp_index_spec.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe DropSoftwareLicensesTempIndex, feature_category: :security_policy_management do
+ it 'correctly migrates up and down' do
+ reversible_migration do |migration|
+ migration.before -> {
+ expect(ActiveRecord::Base.connection.indexes('software_licenses').map(&:name))
+ .to include(described_class::INDEX_NAME)
+ }
+
+ migration.after -> {
+ expect(ActiveRecord::Base.connection.indexes('software_licenses').map(&:name))
+ .not_to include(described_class::INDEX_NAME)
+ }
+ end
+ end
+end