diff options
author | Sergey Suprunenko <suprunenko.s@gmail.com> | 2019-07-14 19:25:03 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-07-14 19:25:03 +0000 |
commit | dce8ebc9eabac1a597491a0edc5c145285c55671 (patch) | |
tree | 58d63391301df259173057ce8ddf81ed52014fef /test/web/common_api/common_api_test.exs | |
parent | 509d8058d99d7455155b6e7fad83fed28f2ae02d (diff) | |
download | pleroma-dce8ebc9eabac1a597491a0edc5c145285c55671.tar.gz |
Unfollow should also unsubscribe
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 958c931c4..b59b6cbf6 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -346,6 +346,20 @@ defmodule Pleroma.Web.CommonAPITest do end end + describe "unfollow/2" do + test "also unsubscribes a user" do + [follower, followed] = insert_pair(:user) + {:ok, follower, followed, _} = CommonAPI.follow(follower, followed) + {:ok, followed} = User.subscribe(follower, followed) + + assert User.subscribed_to?(follower, followed) + + {:ok, follower} = CommonAPI.unfollow(follower, followed) + + refute User.subscribed_to?(follower, followed) + end + end + describe "accept_follow_request/2" do test "after acceptance, it sets all existing pending follow request states to 'accept'" do user = insert(:user, info: %{locked: true}) |