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

20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a6eede8a8f1cefc2347360e4fddfa1cb54925180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'
require_migration!

RSpec.describe DropInt4ColumnsForCiJobArtifacts do
  let(:ci_job_artifacts) { table(:ci_job_artifacts) }

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

      migration.after -> {
        ci_job_artifacts.reset_column_information
        expect(ci_job_artifacts.column_names).not_to include('id_convert_to_bigint')
        expect(ci_job_artifacts.column_names).not_to include('job_id_convert_to_bigint')
      }
    end
  end
end