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

20220523171107_drop_deploy_tokens_token_column_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9cbc6dea6a9770fa16ca29784f1563200454c718 (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 DropDeployTokensTokenColumn, feature_category: :continuous_delivery do
  let(:deploy_tokens) { table(:deploy_tokens) }

  it 'correctly migrates up and down' do
    reversible_migration do |migration|
      migration.before -> {
        expect(deploy_tokens.column_names).to include('token')
      }

      migration.after -> {
        deploy_tokens.reset_column_information

        expect(deploy_tokens.column_names).not_to include('token')
      }
    end
  end
end