summaryrefslogtreecommitdiff
path: root/test/upload_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/upload_test.exs')
-rw-r--r--test/upload_test.exs16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/upload_test.exs b/test/upload_test.exs
index f7b1893ad..32c6977d1 100644
--- a/test/upload_test.exs
+++ b/test/upload_test.exs
@@ -5,6 +5,8 @@
defmodule Pleroma.UploadTest do
use Pleroma.DataCase
+ import ExUnit.CaptureLog
+
alias Pleroma.Upload
alias Pleroma.Uploaders.Uploader
@@ -77,8 +79,12 @@ defmodule Pleroma.UploadTest do
test "it returns error" do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
- assert Upload.store(@upload_file) == {:error, "Errors"}
- Task.await(Agent.get(TestUploaderError, fn task_pid -> task_pid end))
+
+ assert capture_log(fn ->
+ assert Upload.store(@upload_file) == {:error, "Errors"}
+ Task.await(Agent.get(TestUploaderError, fn task_pid -> task_pid end))
+ end) =~
+ "[error] Elixir.Pleroma.Upload store (using Pleroma.UploadTest.TestUploaderError) failed: \"Errors\""
end
end
@@ -89,7 +95,11 @@ defmodule Pleroma.UploadTest do
test "it returns error" do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
- assert Upload.store(@upload_file) == {:error, "Uploader callback timeout"}
+
+ assert capture_log(fn ->
+ assert Upload.store(@upload_file) == {:error, "Uploader callback timeout"}
+ end) =~
+ "[error] Elixir.Pleroma.Upload store (using Pleroma.UploadTest.TestUploader) failed: \"Uploader callback timeout\""
end
end