mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 10:37:16 +08:00
added a job to clean up orphan uploads
This commit is contained in:
@ -10,6 +10,7 @@ describe CookedPostProcessor do
|
||||
let(:post_process) { sequence("post_process") }
|
||||
|
||||
it "post process in sequence" do
|
||||
cpp.expects(:clean_up_reverse_index).in_sequence(post_process)
|
||||
cpp.expects(:post_process_attachments).in_sequence(post_process)
|
||||
cpp.expects(:post_process_images).in_sequence(post_process)
|
||||
cpp.expects(:post_process_oneboxes).in_sequence(post_process)
|
||||
@ -18,6 +19,18 @@ describe CookedPostProcessor do
|
||||
|
||||
end
|
||||
|
||||
context "clean_up_reverse_index" do
|
||||
|
||||
let(:post) { build(:post) }
|
||||
let(:cpp) { CookedPostProcessor.new(post) }
|
||||
|
||||
it "cleans the reverse index up for the current post" do
|
||||
PostUpload.expects(:delete_all).with(post_id: post.id)
|
||||
cpp.clean_up_reverse_index
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "post_process_attachments" do
|
||||
|
||||
context "with attachment" do
|
||||
|
Reference in New Issue
Block a user