diff options
Diffstat (limited to 'spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb')
-rw-r--r-- | spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb b/spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb new file mode 100644 index 00000000000..68fac1c2221 --- /dev/null +++ b/spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require "spec_helper" + +require_migration! + +RSpec.describe AddSyncTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences do + let(:table) { "vulnerability_occurrences" } + let(:index) { described_class::INDEX_NAME } + + it "creates and drops the index" do + reversible_migration do |migration| + migration.before -> do + expect(ActiveRecord::Base.connection.indexes(table).map(&:name)).not_to include(index) + end + + migration.after -> do + expect(ActiveRecord::Base.connection.indexes(table).map(&:name)).to include(index) + end + end + end +end |