summaryrefslogtreecommitdiff
path: root/test/web/common_api
diff options
context:
space:
mode:
Diffstat (limited to 'test/web/common_api')
-rw-r--r--test/web/common_api/common_api_test.exs15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index bcbaad665..f28a66090 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -204,6 +204,21 @@ defmodule Pleroma.Web.CommonAPITest do
assert {:error, "The status is over the character limit"} =
CommonAPI.post(user, %{"status" => "foobar"})
end
+
+ test "it can handle activities that expire" do
+ user = insert(:user)
+
+ expires_at =
+ NaiveDateTime.utc_now()
+ |> NaiveDateTime.truncate(:second)
+ |> NaiveDateTime.add(1_000_000, :second)
+
+ assert {:ok, activity} =
+ CommonAPI.post(user, %{"status" => "chai", "expires_in" => 1_000_000})
+
+ assert expiration = Pleroma.ActivityExpiration.get_by_activity_id(activity.id)
+ assert expiration.scheduled_at == expires_at
+ end
end
describe "reactions" do