diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-25 18:46:17 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-25 18:46:17 +0400 |
commit | 9081a071eecd0eeb4b67008754555e9c9d73eae7 (patch) | |
tree | 11c35df73d961ff829ca392b86015a5244a1e6ed | |
parent | 8eebc75c152ee339bac347350266e3bc6536016b (diff) | |
download | pleroma-9081a071eecd0eeb4b67008754555e9c9d73eae7.tar.gz |
Add a test for accounts/update_credentials
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | 12 |
1 files changed, 12 insertions, 0 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 51cebe567..b693c1a47 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 @@ -118,6 +118,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do assert user_data["pleroma"]["hide_followers"] == true end + test "updates the user's discoverable status", %{conn: conn} do + assert %{"source" => %{"pleroma" => %{"discoverable" => true}}} = + conn + |> patch("/api/v1/accounts/update_credentials", %{discoverable: "true"}) + |> json_response(:ok) + + assert %{"source" => %{"pleroma" => %{"discoverable" => false}}} = + conn + |> patch("/api/v1/accounts/update_credentials", %{discoverable: "false"}) + |> json_response(:ok) + end + test "updates the user's hide_followers_count and hide_follows_count", %{conn: conn} do conn = patch(conn, "/api/v1/accounts/update_credentials", %{ |