added User.NotificationSetting struct
This commit is contained in:
parent
ca1acfa314
commit
a52da55eb9
10 changed files with 146 additions and 42 deletions
|
|
@ -159,11 +159,31 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|
|||
|
||||
user = Repo.get(User, user.id)
|
||||
|
||||
assert %{
|
||||
"followers" => false,
|
||||
"follows" => true,
|
||||
"non_follows" => true,
|
||||
"non_followers" => true
|
||||
assert %Pleroma.User.NotificationSetting{
|
||||
followers: false,
|
||||
follows: true,
|
||||
non_follows: true,
|
||||
non_followers: true,
|
||||
privacy_option: "name_and_message"
|
||||
} == user.notification_settings
|
||||
end
|
||||
|
||||
test "it update notificatin privacy option", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
|> put("/api/pleroma/notification_settings", %{"privacy_option" => "name_only"})
|
||||
|> json_response(:ok)
|
||||
|
||||
user = refresh_record(user)
|
||||
|
||||
assert %Pleroma.User.NotificationSetting{
|
||||
followers: true,
|
||||
follows: true,
|
||||
non_follows: true,
|
||||
non_followers: true,
|
||||
privacy_option: "name_only"
|
||||
} == user.notification_settings
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue