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

23 lines
628 B
Ruby

# 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