Commit 8286a3d8 authored by Stan Hu's avatar Stan Hu

Fix order-dependent migration specs

CleanupOptimisticLockingNulls and CleanupOptimisticLockingNullsPt2 both
defined the constant TABLES, which caused the tests to fail if they were
run together. To fix this, we drop the constant and use straight
definitions.
parent 3178a722
......@@ -4,11 +4,10 @@ require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200217210353_cleanup_optimistic_locking_nulls_pt2')
describe CleanupOptimisticLockingNullsPt2, :migration do
TABLES = %w(ci_stages ci_builds ci_pipelines).freeze
TABLES.each do |table|
let(table.to_sym) { table(table.to_sym) }
end
let(:tables) { TABLES.map { |t| method(t.to_sym).call } }
let(:ci_stages) { table(:ci_stages) }
let(:ci_builds) { table(:ci_builds) }
let(:ci_pipelines) { table(:ci_pipelines) }
let(:tables) { [ci_stages, ci_builds, ci_pipelines] }
before do
# Create necessary rows
......
......@@ -4,11 +4,10 @@ require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200128210353_cleanup_optimistic_locking_nulls')
describe CleanupOptimisticLockingNulls do
TABLES = %w(epics merge_requests issues).freeze
TABLES.each do |table|
let(table.to_sym) { table(table.to_sym) }
end
let(:tables) { TABLES.map { |t| method(t.to_sym).call } }
let(:epics) { table(:epics) }
let(:merge_requests) { table(:merge_requests) }
let(:issues) { table(:issues) }
let(:tables) { [epics, merge_requests, issues] }
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment