Merge branch 'docs/kyclos' into 'develop'
[akkoma] / test / web / mastodon_api / controllers / status_controller_test.exs
index 307221c5d015469d6840b7d0fdd891f1fda403e9..83138d7ef9b2bd07fdc8d93e3d72f5cb53054100 100644 (file)
@@ -370,6 +370,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
 
       assert NaiveDateTime.diff(NaiveDateTime.from_iso8601!(response["poll"]["expires_at"]), time) in 420..430
       refute response["poll"]["expred"]
+
+      question = Object.get_by_id(response["poll"]["id"])
+
+      # closed contains utc timezone
+      assert question.data["closed"] =~ "Z"
     end
 
     test "option limit is enforced", %{conn: conn} do
@@ -638,6 +643,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
       assert to_string(activity.id) == id
     end
 
+    test "favoriting twice will just return 200", %{conn: conn} do
+      activity = insert(:note_activity)
+
+      post(conn, "/api/v1/statuses/#{activity.id}/favourite")
+      assert post(conn, "/api/v1/statuses/#{activity.id}/favourite") |> json_response(200)
+    end
+
     test "returns 400 error for a wrong id", %{conn: conn} do
       conn = post(conn, "/api/v1/statuses/1/favourite")