DEV: Improve specs for 293cf600f0.

This commit is contained in:
Guo Xiang Tan 2018-09-19 16:03:52 +08:00
parent 293cf600f0
commit d403883d16

View File

@ -85,6 +85,9 @@ RSpec.describe UploadRecovery do
expect do
upload_recovery.recover
end.to change { post.reload.uploads.count }.from(0).to(1)
expect(File.read(Discourse.store.path_for(post.uploads.first)))
.to eq(File.read(file_from_fixtures("small.pdf", "pdf")))
end
end
@ -99,6 +102,9 @@ RSpec.describe UploadRecovery do
expect do
upload_recovery.recover
end.to change { post.reload.uploads.count }.from(0).to(1)
expect(File.read(Discourse.store.path_for(post.uploads.first)))
.to eq(File.read(file_from_fixtures("smallest.png")))
end
end
end