uploads: switch to active job.

* Switch upload processing from DelayedJob to ActiveJob.
* Remove remaining references to delayed job from tests.

Closes #4128.
This commit is contained in:
evazion
2019-09-23 15:11:18 -05:00
parent 8de6925807
commit 0a6661d145
9 changed files with 30 additions and 36 deletions

View File

@@ -36,17 +36,12 @@ class PostTest < ActiveSupport::TestCase
context "Deletion:" do
context "Expunging a post" do
setup do
Delayed::Worker.delay_jobs = true
@upload = UploadService.new(FactoryBot.attributes_for(:jpg_upload)).start!
@post = @upload.post
Favorite.add(post: @post, user: @user)
create(:favorite_group).add!(@post.id)
end
teardown do
Delayed::Worker.delay_jobs = false
end
should "delete the files" do
assert_nothing_raised { @post.file(:preview) }
assert_nothing_raised { @post.file(:original) }