A platform for community discussion. Free, open, simple.
DEV: Restore UploadRecovery specs (#10543)
Jarek Radosz188d22430344
diff --git a/lib/upload_recovery.rb b/lib/upload_recovery.rbindex 7ea190c02d8..221e1d3e957 100644--- a/lib/upload_recovery.rb+++ b/lib/upload_recovery.rb@@ -95,21 +95,14 @@ class UploadRecoveryenddef recover_from_local(sha1:, user_id:)- public_path = Rails.root.join("public")-@paths ||= beginDir.glob(File.join(- public_path,- 'uploads',- 'tombstone',- RailsMultisite::ConnectionManagement.current_db,+ Discourse.store.tombstone_dir,'original','**','*.*')).concat(Dir.glob(File.join(- public_path,- 'uploads',- RailsMultisite::ConnectionManagement.current_db,+ Discourse.store.upload_path,'original','**','*.*'diff --git a/spec/lib/upload_recovery_spec.rb b/spec/lib/upload_recovery_spec.rbindex 3d8b840b1fe..9a18a34dbd6 100644--- a/spec/lib/upload_recovery_spec.rb+++ b/spec/lib/upload_recovery_spec.rb@@ -49,7 +49,7 @@ RSpec.describe UploadRecovery dodescribe '#recover' dodescribe 'when given an invalid sha1' do- xit 'should not do anything' do+ it 'does nothing' doupload_recovery.expects(:recover_from_local).neverpost.update!(@@ -66,7 +66,7 @@ RSpec.describe UploadRecovery doendend- xit 'accepts a custom ActiveRecord relation' do+ it 'accepts a custom ActiveRecord relation' dopost.update!(updated_at: 2.days.ago)upload.destroy!@@ -85,7 +85,7 @@ RSpec.describe UploadRecovery do).tap(&:link_post_uploads)end- xit 'should recover the attachment' do+ it 'recovers the attachment' doexpect doupload2.destroy!end.to change { post.reload.uploads.count }.from(1).to(0)@@ -99,7 +99,7 @@ RSpec.describe UploadRecovery doendend- xit 'should recover uploads and attachments' do+ it 'recovers uploads and attachments' dostub_request(:get, "http://test.localhost#{upload.url}").to_return(status: 200)@@ -125,7 +125,7 @@ RSpec.describe UploadRecovery do).tap(&:link_post_uploads)end- xit 'should recover the upload' do+ it 'recovers the upload' dostub_request(:get, "http://test.localhost#{upload.url}").to_return(status: 200)@@ -152,7 +152,7 @@ RSpec.describe UploadRecovery do).tap(&:link_post_uploads)end- xit 'should recover the upload' do+ it 'recovers the upload' dostub_request(:get, "http://test.localhost#{upload.url}").to_return(status: 200)@@ -179,7 +179,7 @@ RSpec.describe UploadRecovery do).tap(&:link_post_uploads)end- xit 'should recover the upload' do+ it 'recovers the upload' dostub_request(:get, "http://test.localhost#{upload.url}").to_return(status: 200)