summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-06-04 13:28:00 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-06-04 13:28:00 +0400
commitb4d5bdd6f1c473280b8b9bbad96e9efecb45b298 (patch)
tree6d08f332f7bd1bc20f7bd3904987850173f90af0 /test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
parent06f20e918129b1f434783b64d59b5ae6b4b4ed51 (diff)
parentd6693a91028ab3ee7865f530f3ad2532542fc2d2 (diff)
downloadpleroma-b4d5bdd6f1c473280b8b9bbad96e9efecb45b298.tar.gz
pleroma-b4d5bdd6f1c473280b8b9bbad96e9efecb45b298.zip
Merge branch 'develop' into openapi/admin/config
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs38
1 files changed, 23 insertions, 15 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 696228203..7c420985d 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
@@ -8,6 +8,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
use Pleroma.Web.ConnCase
+ import Mock
import Pleroma.Factory
setup do: clear_config([:instance, :max_account_fields])
@@ -52,24 +53,31 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
user = Repo.get(User, user_data["id"])
- res_conn =
- conn
- |> assign(:user, user)
- |> patch("/api/v1/accounts/update_credentials", %{
- "pleroma_settings_store" => %{
- masto_fe: %{
- theme: "blub"
+ clear_config([:instance, :federating], true)
+
+ with_mock Pleroma.Web.Federator,
+ publish: fn _activity -> :ok end do
+ res_conn =
+ conn
+ |> assign(:user, user)
+ |> patch("/api/v1/accounts/update_credentials", %{
+ "pleroma_settings_store" => %{
+ masto_fe: %{
+ theme: "blub"
+ }
}
- }
- })
+ })
- assert user_data = json_response_and_validate_schema(res_conn, 200)
+ assert user_data = json_response_and_validate_schema(res_conn, 200)
- assert user_data["pleroma"]["settings_store"] ==
- %{
- "pleroma_fe" => %{"theme" => "bla"},
- "masto_fe" => %{"theme" => "blub"}
- }
+ assert user_data["pleroma"]["settings_store"] ==
+ %{
+ "pleroma_fe" => %{"theme" => "bla"},
+ "masto_fe" => %{"theme" => "blub"}
+ }
+
+ assert_called(Pleroma.Web.Federator.publish(:_))
+ end
end
test "updates the user's bio", %{conn: conn} do