personal snippets will now comply with `background_upload`
This commit is contained in:
parent
2dbd31c1bb
commit
c0047fc473
|
@ -10,7 +10,11 @@ class FileMover
|
|||
|
||||
def execute
|
||||
move
|
||||
uploader.record_upload if update_markdown
|
||||
|
||||
if update_markdown
|
||||
uploader.record_upload
|
||||
uploader.schedule_background_upload
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -52,6 +52,7 @@ module ObjectStorage
|
|||
|
||||
def schedule_background_upload(*args)
|
||||
return unless schedule_background_upload?
|
||||
return unless upload
|
||||
|
||||
ObjectStorage::BackgroundMoveWorker.perform_async(self.class.name,
|
||||
upload.class.to_s,
|
||||
|
|
|
@ -36,6 +36,12 @@ describe FileMover do
|
|||
it 'creates a new update record' do
|
||||
expect { subject }.to change { Upload.count }.by(1)
|
||||
end
|
||||
|
||||
it 'schedules a background migration' do
|
||||
expect_any_instance_of(PersonalFileUploader).to receive(:schedule_background_upload).once
|
||||
|
||||
subject
|
||||
end
|
||||
end
|
||||
|
||||
context 'when update_markdown fails' do
|
||||
|
|
Loading…
Reference in New Issue