logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 3a8b5d90df6de502debaee4d670211bcf64ad1db
parent c20e90e898affc9d00d8b7d6b71f11157f5c7837
Author: Alex Gleason <alex@alexgleason.me>
Date:   Sat, 22 Jan 2022 22:35:08 -0600

StatusControllerTest: test creating a quote post

Diffstat:

Mtest/pleroma/web/mastodon_api/controllers/status_controller_test.exs19+++++++++++++++++++
1 file 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 @@ -125,6 +125,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