summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2022-01-22 22:35:08 -0600
committerAlex Gleason <alex@alexgleason.me>2022-01-22 22:35:08 -0600
commitbbd3433f5af8c3aa9774131bafd951e0bd1e3d80 (patch)
tree33828c9d08a6d59907a66918d2591fabae15fc1c
parent4b2fe550def089b1f2ae24f922c871ec2dadf41c (diff)
StatusControllerTest: test creating a quote post
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs19
1 files changed, 19 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..8eaf9713d 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -124,6 +124,25 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
)
end
+ test "posting a quote post", %{conn: conn} do
+ user = insert(:user)
+
+ {:ok, %{id: activity_id}} = CommonAPI.post(user, %{status: "yolo"})
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/statuses", %{
+ "status" => "indeed",
+ "quote_id" => activity_id
+ })
+
+ assert %{"id" => id, "pleroma" => %{"quote" => %{"id" => ^activity_id}}} =
+ json_response_and_validate_schema(conn, 200)
+
+ assert Activity.get_by_id(id)
+ end
+
test "it fails to create a status if `expires_in` is less or equal than an hour", %{
conn: conn
} do