Validate client application metadata is retained in the object
authorMark Felder <feld@feld.me>
Thu, 11 Feb 2021 21:07:21 +0000 (15:07 -0600)
committerMark Felder <feld@feld.me>
Thu, 11 Feb 2021 21:07:21 +0000 (15:07 -0600)
test/pleroma/web/mastodon_api/controllers/status_controller_test.exs

index dcd1e6d5b8bfa78fd1b12dc8e58168fa559dec25..fada7c25c625cba9ed2984b8e36ba1fd761ce3e6 100644 (file)
@@ -357,6 +357,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
       assert activity.data["to"] == [user2.ap_id]
       assert activity.data["cc"] == []
     end
+
+    test "preserves client application metadata", %{conn: conn} do
+      result =
+        conn
+        |> put_req_header("content-type", "application/json")
+        |> post("/api/v1/statuses", %{
+          "status" => "cofe is my copilot"
+        })
+
+      assert %{
+               "content" => "cofe is my copilot",
+               "application" => %{
+                 "name" => "Some client 0",
+                 "website" => "https://example.com"
+               }
+             } = json_response_and_validate_schema(result, 200)
+    end
   end
 
   describe "posting scheduled statuses" do