diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-11-12 18:36:50 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-11-12 18:45:28 +0700 |
commit | e6d7e27bd603806e96dfc2774f90cadb3cf73a8c (patch) | |
tree | 96b9c5de9bc8c43ee3bcd1e449bb19cec950a6e6 /test/web/mastodon_api | |
parent | 61fc739ab8917ccb5a12d6ab6db6130dc231990b (diff) | |
download | pleroma-e6d7e27bd603806e96dfc2774f90cadb3cf73a8c.tar.gz |
Add `allow_following_move` setting to User
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | 15 | ||||
-rw-r--r-- | test/web/mastodon_api/views/account_view_test.exs | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs index 519b56d6c..77cfce4fa 100644 --- a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs +++ b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs @@ -103,6 +103,21 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do assert user["locked"] == true end + test "updates the user's allow_following_move", %{conn: conn} do + user = insert(:user) + + assert user.allow_following_move == true + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{allow_following_move: "false"}) + + assert refresh_record(user).allow_following_move == false + assert user = json_response(conn, 200) + assert user["pleroma"]["allow_following_move"] == false + end + test "updates the user's default scope", %{conn: conn} do user = insert(:user) diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs index af88841ed..3aa5d2e3b 100644 --- a/test/web/mastodon_api/views/account_view_test.exs +++ b/test/web/mastodon_api/views/account_view_test.exs @@ -102,7 +102,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do privacy = user.default_scope assert %{ - pleroma: %{notification_settings: ^notification_settings}, + pleroma: %{notification_settings: ^notification_settings, allow_following_move: true}, source: %{privacy: ^privacy} } = AccountView.render("show.json", %{user: user, for: user}) end |