aboutsummaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/status_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-01-20 14:27:59 +0100
committerlain <lain@soykaf.club>2020-01-20 14:27:59 +0100
commit510776ba31f0bb01217fd6585848657f5bceb5f7 (patch)
tree8533bdcc0617c176aa2ac91ba6bedb5422115294 /test/web/mastodon_api/controllers/status_controller_test.exs
parentc814f22030c1341ec337bdd1c446536597e683e2 (diff)
downloadpleroma-510776ba31f0bb01217fd6585848657f5bceb5f7.tar.gz
CommonAPI: Don't error out on double favs/repeats
Diffstat (limited to 'test/web/mastodon_api/controllers/status_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/status_controller_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs
index 307221c5d..0b75fcc91 100644
--- a/test/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/web/mastodon_api/controllers/status_controller_test.exs
@@ -638,6 +638,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/v2/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")