diff options
author | lain <lain@soykaf.club> | 2018-11-02 17:33:51 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-11-02 17:33:51 +0100 |
commit | 45ebc8dd9a27ae862aad1c8251a71b95a2c3be17 (patch) | |
tree | f7bc08dd40f51b6e9466a66ecc25cec44a10e6ea /test | |
parent | f114f843248d207ff240b018a774ce32c34b6eaf (diff) | |
download | pleroma-45ebc8dd9a27ae862aad1c8251a71b95a2c3be17.tar.gz |
Check for empty string in_reply_to ids.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 42a43f129..938d556c7 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -198,6 +198,21 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert activity.data["object"]["inReplyToStatusId"] == replied_to.id end + test "posting a status with an invalid in_reply_to_id", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> post("/api/v1/statuses", %{"status" => "xD", "in_reply_to_id" => ""}) + + assert %{"content" => "xD", "id" => id} = json_response(conn, 200) + + activity = Repo.get(Activity, id) + + assert activity + end + test "verify_credentials", %{conn: conn} do user = insert(:user) |