Pull out row_worker_job_args in bulk import service spec

This commit is contained in:
Matt Jankowski 2024-09-23 10:09:18 -04:00
parent 0823e389dd
commit dc41531c09

View File

@ -34,7 +34,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows.map(&:id))
expect(row_worker_job_args).to match_array(rows.map(&:id))
end
it 'requests to follow all the listed users once the workers have run' do
@ -79,7 +79,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows[1..].map(&:id))
expect(row_worker_job_args).to match_array(rows[1..].map(&:id))
end
it 'requests to follow all the expected users once the workers have run' do
@ -114,7 +114,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows.map(&:id))
expect(row_worker_job_args).to match_array(rows.map(&:id))
end
it 'blocks all the listed users once the workers have run' do
@ -155,7 +155,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows[1..].map(&:id))
expect(row_worker_job_args).to match_array(rows[1..].map(&:id))
end
it 'requests to follow all the expected users once the workers have run' do
@ -190,7 +190,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows.map(&:id))
expect(row_worker_job_args).to match_array(rows.map(&:id))
end
it 'mutes all the listed users once the workers have run' do
@ -235,7 +235,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows[1..].map(&:id))
expect(row_worker_job_args).to match_array(rows[1..].map(&:id))
end
it 'requests to follow all the expected users once the workers have run' do
@ -331,7 +331,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows.map(&:id))
expect(row_worker_job_args).to match_array(rows.map(&:id))
end
it 'updates the bookmarks as expected once the workers have run' do
@ -371,7 +371,7 @@ RSpec.describe BulkImportService do
it 'enqueues workers for the expected rows' do
subject.call(import)
expect(Import::RowWorker.jobs.pluck('args').flatten).to match_array(rows.map(&:id))
expect(row_worker_job_args).to match_array(rows.map(&:id))
end
it 'updates the bookmarks as expected once the workers have run' do
@ -385,6 +385,13 @@ RSpec.describe BulkImportService do
end
end
def row_worker_job_args
Import::RowWorker
.jobs
.pluck('args')
.flatten
end
def stub_resolve_account_service
resolve_account_service_double = instance_double(ResolveAccountService)