blob: 68fac1c2221867c7c0d2b06b03b72bb316ebaa86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
|