aboutsummaryrefslogtreecommitdiff
path: root/test/web
diff options
context:
space:
mode:
authorlambda <lain@soykaf.club>2019-04-10 10:04:20 +0000
committerlambda <lain@soykaf.club>2019-04-10 10:04:20 +0000
commit6504b43f96860d1911ed9a17d1c487a6e8ac93ba (patch)
tree8414fc2108941ccadd9b9fd4dd37c9d3cf731399 /test/web
parentc8440b5e0c97c5d5c03e4b99e30a61df6ab95319 (diff)
parentbe8350baa2f8c9cf9be3f53ee4a0041dada1386f (diff)
downloadpleroma-6504b43f96860d1911ed9a17d1c487a6e8ac93ba.tar.gz
Merge branch 'feature/user-status-subscriptions' into 'develop'
Add ability to subscribe to users See merge request pleroma/pleroma!1024
Diffstat (limited to 'test/web')
-rw-r--r--test/web/mastodon_api/account_view_test.exs2
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs19
2 files changed, 21 insertions, 0 deletions
diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs
index aa6a1e960..d7487bed9 100644
--- a/test/web/mastodon_api/account_view_test.exs
+++ b/test/web/mastodon_api/account_view_test.exs
@@ -156,6 +156,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
blocking: true,
muting: false,
muting_notifications: false,
+ subscribing: false,
requested: false,
domain_blocking: false,
showing_reblogs: true,
@@ -212,6 +213,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
following: false,
followed_by: false,
blocking: true,
+ subscribing: false,
muting: false,
muting_notifications: false,
requested: false,
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index e16862a48..3ac5c37a6 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -1556,6 +1556,25 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert %{"id" => _id, "muting" => false} = json_response(conn, 200)
end
+ test "subscribing / unsubscribing to a user", %{conn: conn} do
+ user = insert(:user)
+ subscription_target = insert(:user)
+
+ conn =
+ conn
+ |> assign(:user, user)
+ |> post("/api/v1/pleroma/accounts/#{subscription_target.id}/subscribe")
+
+ assert %{"id" => _id, "subscribing" => true} = json_response(conn, 200)
+
+ conn =
+ build_conn()
+ |> assign(:user, user)
+ |> post("/api/v1/pleroma/accounts/#{subscription_target.id}/unsubscribe")
+
+ assert %{"id" => _id, "subscribing" => false} = json_response(conn, 200)
+ end
+
test "getting a list of mutes", %{conn: conn} do
user = insert(:user)
other_user = insert(:user)