diff options
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index b773c323e..0e778d887 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -1,7 +1,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do use Pleroma.DataCase alias Pleroma.Web.ActivityPub.ActivityPub - alias Pleroma.Activity + alias Pleroma.{Activity, Object} alias Pleroma.Builders.ActivityBuilder describe "insertion" do @@ -94,4 +94,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert last == last_expected end end + + describe "uploading files" do + test "copies the file to the configured folder" do + file = %Plug.Upload{content_type: "image/jpg", path: Path.absname("test/fixtures/image.jpg"), filename: "an_image.jpg"} + + {:ok, %Object{} = object} = ActivityPub.upload(file) + assert object.data["name"] == "an_image.jpg" + end + end end |