diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2020-04-23 23:51:38 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-04-23 23:51:38 +0300 |
commit | 3badbffa0aa04c95ad566ad64f9069ff6dc8f307 (patch) | |
tree | ba702916fcae47958118ea30bab1de87b2dd7e8c /test/web/common_api/common_api_test.exs | |
parent | 416a37fcefbd38d01a46b15e6af039b99a22ee0b (diff) | |
parent | 1b5f8d19eeccfe202c0377079caa6a1d6f3cacb5 (diff) | |
download | pleroma-3badbffa0aa04c95ad566ad64f9069ff6dc8f307.tar.gz |
Merge branch 'develop' into refactor/fe-bundles
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 68a29108a..e87193c83 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -283,6 +283,16 @@ defmodule Pleroma.Web.CommonAPITest do {:ok, %Activity{}, _} = CommonAPI.repeat(activity.id, user) end + test "can't repeat a repeat" do + user = insert(:user) + other_user = insert(:user) + {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"}) + + {:ok, %Activity{} = announce, _} = CommonAPI.repeat(activity.id, other_user) + + refute match?({:ok, %Activity{}, _}, CommonAPI.repeat(announce.id, user)) + end + test "repeating a status privately" do user = insert(:user) other_user = insert(:user) @@ -312,8 +322,8 @@ defmodule Pleroma.Web.CommonAPITest do other_user = insert(:user) {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"}) - {:ok, %Activity{} = activity, object} = CommonAPI.repeat(activity.id, user) - {:ok, ^activity, ^object} = CommonAPI.repeat(activity.id, user) + {:ok, %Activity{} = announce, object} = CommonAPI.repeat(activity.id, user) + {:ok, ^announce, ^object} = CommonAPI.repeat(activity.id, user) end test "favoriting a status twice returns ok, but without the like activity" do @@ -387,7 +397,9 @@ defmodule Pleroma.Web.CommonAPITest do user = refresh_record(user) - assert {:ok, ^activity} = CommonAPI.unpin(activity.id, user) + id = activity.id + + assert match?({:ok, %{id: ^id}}, CommonAPI.unpin(activity.id, user)) user = refresh_record(user) |