summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/mastodon_api_controller_test.exs
diff options
context:
space:
mode:
authorkaniini <ariadne@dereferenced.org>2019-09-26 03:00:38 +0000
committerkaniini <ariadne@dereferenced.org>2019-09-26 03:00:38 +0000
commit48a82c46096a560fe9331a63f19ace6faaf98c3d (patch)
tree02c6216dbcb3814115aa64de0ef5a171121b527e /test/web/mastodon_api/mastodon_api_controller_test.exs
parent59ae9255fbf7abd6efe46799b19c094724f5d51b (diff)
parent035f22f7849815c5f77a734c56f409c0f08ac853 (diff)
downloadpleroma-48a82c46096a560fe9331a63f19ace6faaf98c3d.tar.gz
pleroma-48a82c46096a560fe9331a63f19ace6faaf98c3d.zip
Merge branch 'refactor/user' into 'develop'
Simplify updating user's `info` See merge request pleroma/pleroma!1712
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index 73a3bf135..e32468f85 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -2613,14 +2613,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
{:ok, _} = CommonAPI.post(user, %{"status" => "cofe"})
# Stats should count users with missing or nil `info.deactivated` value
- user = User.get_cached_by_id(user.id)
- info_change = Changeset.change(user.info, %{deactivated: nil})
{:ok, _user} =
- user
- |> Changeset.change()
- |> Changeset.put_embed(:info, info_change)
- |> User.update_and_set_cache()
+ user.id
+ |> User.get_cached_by_id()
+ |> User.update_info(&Changeset.change(&1, %{deactivated: nil}))
Pleroma.Stats.force_update()
@@ -3953,13 +3950,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
describe "POST /api/v1/pleroma/accounts/confirmation_resend" do
setup do
- user = insert(:user)
- info_change = User.Info.confirmation_changeset(user.info, need_confirmation: true)
-
{:ok, user} =
- user
- |> Changeset.change()
- |> Changeset.put_embed(:info, info_change)
+ insert(:user)
+ |> User.change_info(&User.Info.confirmation_changeset(&1, need_confirmation: true))
|> Repo.update()
assert user.info.confirmation_pending