gitlab-org--gitlab-foss/spec/migrations/track_untracked_uploads_spec.rb
Michael Kozono 03cba8c0f1 Fix specs after rebase
Later migrations added fields to the EE DB which were used by factories which were used in these specs.

And in CE on MySQL, a single appearance row is enforced.

The migration and migration specs should not depend on the codebase staying the same.
2017-12-06 09:34:25 -08:00

27 lines
759 B
Ruby

require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20171103140253_track_untracked_uploads')
describe TrackUntrackedUploads, :migration, :sidekiq do
include TrackUntrackedUploadsHelpers
matcher :be_scheduled_migration do
match do |migration|
BackgroundMigrationWorker.jobs.any? do |job|
job['args'] == [migration]
end
end
failure_message do |migration|
"Migration `#{migration}` with args `#{expected.inspect}` not scheduled!"
end
end
it 'correctly schedules the follow-up background migration' do
Sidekiq::Testing.fake! do
migrate!
expect(described_class::MIGRATION).to be_scheduled_migration
expect(BackgroundMigrationWorker.jobs.size).to eq(1)
end
end
end