summaryrefslogtreecommitdiff
path: root/spec/migrations/20230329100222_drop_software_licenses_temp_index_spec.rb
blob: d4d276980f812dfc0c6e6dfb9fb8f5de6f3e213e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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