Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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