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

20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8891d8a990793c5800ab46e1791dcedd1ba5a2a4 (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 DropTmpIndexOauthAccessTokensOnIdWhereExpiresInNull, feature_category: :database do
  it 'correctly migrates up and down' do
    reversible_migration do |migration|
      migration.before -> {
        expect(ActiveRecord::Base.connection.indexes('oauth_access_tokens').map(&:name))
          .to include(described_class::TMP_INDEX)
      }

      migration.after -> {
        expect(ActiveRecord::Base.connection.indexes('oauth_access_tokens').map(&:name))
          .not_to include(described_class::TMP_INDEX)
      }
    end
  end
end