summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-06-08 11:05:48 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-06-08 11:05:48 -0400
commit237b220d71bfe7db66db12549851fb93900a060a (patch)
treedfca661a596ebb2d09e08f2fa5acd3cb246659c9 /test
parentd2d3532e5f3e5bcedc91fd0f5ac4ca69043348db (diff)
downloadpleroma-237b220d71bfe7db66db12549851fb93900a060a.tar.gz
pleroma-237b220d71bfe7db66db12549851fb93900a060a.zip
Add object id to uploaded attachments
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/upload_test.exs30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/pleroma/upload_test.exs b/test/pleroma/upload_test.exs
index f2795f985..6584c2def 100644
--- a/test/pleroma/upload_test.exs
+++ b/test/pleroma/upload_test.exs
@@ -49,20 +49,22 @@ defmodule Pleroma.UploadTest do
test "it returns file" do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
- assert Upload.store(@upload_file) ==
- {:ok,
- %{
- "name" => "image.jpg",
- "type" => "Document",
- "mediaType" => "image/jpeg",
- "url" => [
- %{
- "href" => "http://localhost:4001/media/post-process-file.jpg",
- "mediaType" => "image/jpeg",
- "type" => "Link"
- }
- ]
- }}
+ assert {:ok, result} = Upload.store(@upload_file)
+
+ assert result ==
+ %{
+ "id" => result["id"],
+ "name" => "image.jpg",
+ "type" => "Document",
+ "mediaType" => "image/jpeg",
+ "url" => [
+ %{
+ "href" => "http://localhost:4001/media/post-process-file.jpg",
+ "mediaType" => "image/jpeg",
+ "type" => "Link"
+ }
+ ]
+ }
Task.await(Agent.get(TestUploaderSuccess, fn task_pid -> task_pid end))
end