2018-07-03 12:23:17 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
require Rails.root.join('db', 'post_migrate', '20180619121030_enqueue_delete_diff_files_workers.rb')
|
|
|
|
|
|
|
|
describe EnqueueDeleteDiffFilesWorkers, :migration, :sidekiq do
|
2018-07-09 21:34:30 +00:00
|
|
|
it 'correctly schedules diff files deletion schedulers' do
|
2018-07-03 12:23:17 +00:00
|
|
|
Sidekiq::Testing.fake! do
|
2018-07-04 19:06:30 +00:00
|
|
|
expect(BackgroundMigrationWorker)
|
|
|
|
.to receive(:perform_async)
|
2018-07-09 21:34:30 +00:00
|
|
|
.with(described_class::SCHEDULER)
|
2018-07-03 20:05:19 +00:00
|
|
|
.and_call_original
|
2018-07-03 12:23:17 +00:00
|
|
|
|
2018-07-03 20:05:19 +00:00
|
|
|
migrate!
|
|
|
|
|
2018-07-04 19:06:30 +00:00
|
|
|
expect(BackgroundMigrationWorker.jobs.size).to eq(1)
|
2018-07-03 20:05:19 +00:00
|
|
|
end
|
2018-07-03 12:23:17 +00:00
|
|
|
end
|
|
|
|
end
|