diff options
Diffstat (limited to 'spec/migrations/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null_spec.rb')
-rw-r--r-- | spec/migrations/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/migrations/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null_spec.rb b/spec/migrations/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null_spec.rb new file mode 100644 index 00000000000..8891d8a9907 --- /dev/null +++ b/spec/migrations/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null_spec.rb @@ -0,0 +1,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 |