X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fmastodon_api%2Fmastodon_api_controller_test.exs;h=883ebc61e085cefb37d89f8368c145c78fd6cf16;hb=76722ea9c8dfbb8fefe247883946aa5c872d9a49;hp=432dca28a4aa6224eb562dfc1b1942faa7c5ad4d;hpb=fcd3eca167508c1dde290f431353ace9d513de86;p=akkoma diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 432dca28a..883ebc61e 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -75,6 +75,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do "sensitive" => "false" }) + {:ok, ttl} = Cachex.ttl(:idempotency_cache, idempotency_key) + # Six hours + assert ttl > :timer.seconds(6 * 60 * 60 - 1) + assert %{"content" => "cofe", "id" => id, "spoiler_text" => "2hu", "sensitive" => false} = json_response(conn_one, 200) @@ -93,6 +97,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert %{"id" => second_id} = json_response(conn_two, 200) assert id == second_id + + conn_three = + conn + |> assign(:user, user) + |> post("/api/v1/statuses", %{ + "status" => "cofe", + "spoiler_text" => "2hu", + "sensitive" => "false" + }) + + assert %{"id" => third_id} = json_response(conn_three, 200) + + refute id == third_id end test "posting a sensitive status", %{conn: conn} do