1 defmodule Pleroma.UserInfoTest do
3 alias Pleroma.User.Info
9 describe "update_email_notifications/2" do
11 user = insert(:user, %{info: %{email_notifications: %{"digest" => true}}})
16 test "Notifications are updated", %{user: user} do
17 true = user.info.email_notifications["digest"]
18 changeset = Info.update_email_notifications(user.info, %{"digest" => false})
19 assert changeset.valid?
20 {:ok, result} = Ecto.Changeset.apply_action(changeset, :insert)
21 assert result.email_notifications["digest"] == false