mirror of
https://github.com/glitch-soc/mastodon
synced 2025-04-24 21:14:51 +00:00
Combine examples to reduce factories in BulkImportWorker
spec (#34499)
This commit is contained in:
parent
bc32ff9b57
commit
8dea1c422a
1 changed files with 5 additions and 7 deletions
|
@ -14,13 +14,11 @@ RSpec.describe BulkImportWorker do
|
||||||
allow(BulkImportService).to receive(:new).and_return(service_double)
|
allow(BulkImportService).to receive(:new).and_return(service_double)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'changes the import\'s state as appropriate' do
|
it 'calls the service and changes the import state' do
|
||||||
expect { subject.perform(import.id) }.to change { import.reload.state.to_sym }.from(:scheduled).to(:in_progress)
|
expect { subject.perform(import.id) }
|
||||||
end
|
.to change { import.reload.state.to_sym }.from(:scheduled).to(:in_progress)
|
||||||
|
expect(service_double)
|
||||||
it 'calls BulkImportService' do
|
.to have_received(:call).with(import)
|
||||||
subject.perform(import.id)
|
|
||||||
expect(service_double).to have_received(:call).with(import)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue