mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
Accept custom AR relation for UploadRecovery
.
This commit is contained in:
@ -46,6 +46,14 @@ RSpec.describe UploadRecovery do
|
||||
end
|
||||
end
|
||||
|
||||
it 'accepts a custom ActiveRecord relation' do
|
||||
post.update!(updated_at: 2.days.ago)
|
||||
upload.destroy!
|
||||
|
||||
upload_recovery.expects(:recover_from_local).never
|
||||
upload_recovery.recover(Post.where("updated_at >= ?", 1.day.ago))
|
||||
end
|
||||
|
||||
it 'should recover the upload' do
|
||||
stub_request(:get, "http://test.localhost#{upload.url}")
|
||||
.to_return(status: 200)
|
||||
|
Reference in New Issue
Block a user