summaryrefslogtreecommitdiff
path: root/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/pleroma/web/mastodon_api/controllers/status_controller_test.exs')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index ed66d370a..73dfd40f1 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -182,6 +182,18 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert json_response_and_validate_schema(conn, 200)
end
+ test "posting an undefined status with arbitrary URL as attachment", %{conn: conn} do
+ assert response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/statuses", %{
+ "media_ids" => ["https://example.org/corndog.jpeg"]
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert [%{"url" => "https://example.org/corndog.jpeg"}] = response["media_attachments"]
+ end
+
test "replying to a status", %{user: user, conn: conn} do
{:ok, replied_to} = CommonAPI.post(user, %{status: "cofe"})