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

20221221110733_remove_temp_index_for_project_statistics_upload_size_migration_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 440a932c76b04bc116f0acca64e9d3b18ac47e5b (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 RemoveTempIndexForProjectStatisticsUploadSizeMigration,
  feature_category: :consumables_cost_management do
  let(:table_name) { 'project_statistics' }
  let(:index_name) { described_class::INDEX_NAME }

  it 'correctly migrates up and down' do
    reversible_migration do |migration|
      migration.before -> {
        expect(subject.index_exists_by_name?(table_name, index_name)).to be_truthy
      }

      migration.after -> {
        expect(subject.index_exists_by_name?(table_name, index_name)).to be_falsy
      }
    end
  end
end