diff options
author | Alex S <alex.strizhakov@gmail.com> | 2019-04-10 18:06:54 +0700 |
---|---|---|
committer | Alex S <alex.strizhakov@gmail.com> | 2019-04-10 18:06:54 +0700 |
commit | fe511a6c653f24f95dd3bed5941724e3d0155f3a (patch) | |
tree | 097971af07615b9965329d595d9cb00c7ef2d5f8 /test/web/mastodon_api | |
parent | fe13a1d78c13fbe7b3027d442a6f6906440e5acc (diff) | |
parent | e5d553aa45ffa218b0695d7976f012bfc1dcbafe (diff) | |
download | pleroma-fe511a6c653f24f95dd3bed5941724e3d0155f3a.tar.gz pleroma-fe511a6c653f24f95dd3bed5941724e3d0155f3a.zip |
Merge branch 'develop' into feature/788-separate-email-addresses
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/account_view_test.exs | 16 | ||||
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 19 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index 6dc60afe9..d7487bed9 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -71,6 +71,20 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do assert expected == AccountView.render("account.json", %{user: user}) end + test "Represent the user account for the account owner" do + user = insert(:user) + + notification_settings = %{ + "remote" => true, + "local" => true, + "followers" => true, + "follows" => true + } + + assert %{pleroma: %{notification_settings: ^notification_settings}} = + AccountView.render("account.json", %{user: user, for: user}) + end + test "Represent a Service(bot) account" do user = insert(:user, %{ @@ -142,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, @@ -198,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 24e258d66..614b950ba 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) |