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

21 lines
619 B
Ruby

# 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