debian-mirror-gitlab/spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb
2023-06-20 00:43:36 +05:30

24 lines
659 B
Ruby

# frozen_string_literal: true
require "spec_helper"
require_migration!
RSpec.describe AddSyncTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences,
feature_category: :vulnerability_management 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