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

20230321153035_add_package_id_created_at_desc_index_to_package_files_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 68f3b1f23a904e493e23dd0f589ec5a83ebc89c6 (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 AddPackageIdCreatedAtDescIndexToPackageFiles, feature_category: :package_registry do
  it 'correctly migrates up and down' do
    reversible_migration do |migration|
      migration.before -> {
        expect(ActiveRecord::Base.connection.indexes('packages_package_files').map(&:name))
          .not_to include('index_packages_package_files_on_package_id_and_created_at_desc')
      }

      migration.after -> {
        expect(ActiveRecord::Base.connection.indexes('packages_package_files').map(&:name))
          .to include('index_packages_package_files_on_package_id_and_created_at_desc')
      }
    end
  end
end