Rename notification "privacy_option" setting
This commit is contained in:
parent
fd5e797379
commit
69848d5c97
10 changed files with 45 additions and 26 deletions
|
|
@ -97,7 +97,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
|
||||
notification_settings = %{
|
||||
block_from_strangers: false,
|
||||
privacy_option: false
|
||||
hide_notification_contents: false
|
||||
}
|
||||
|
||||
privacy = user.default_scope
|
||||
|
|
|
|||
|
|
@ -238,9 +238,9 @@ defmodule Pleroma.Web.Push.ImplTest do
|
|||
}
|
||||
end
|
||||
|
||||
test "hides details for notifications when privacy option enabled" do
|
||||
test "hides contents of notifications when option enabled" do
|
||||
user = insert(:user, nickname: "Bob")
|
||||
user2 = insert(:user, nickname: "Rob", notification_settings: %{privacy_option: true})
|
||||
user2 = insert(:user, nickname: "Rob", notification_settings: %{hide_notification_contents: true})
|
||||
|
||||
{:ok, activity} =
|
||||
CommonAPI.post(user, %{
|
||||
|
|
@ -284,9 +284,9 @@ defmodule Pleroma.Web.Push.ImplTest do
|
|||
}
|
||||
end
|
||||
|
||||
test "returns regular content for notifications with privacy option disabled" do
|
||||
test "returns regular content when hiding contents option disabled" do
|
||||
user = insert(:user, nickname: "Bob")
|
||||
user2 = insert(:user, nickname: "Rob", notification_settings: %{privacy_option: false})
|
||||
user2 = insert(:user, nickname: "Rob", notification_settings: %{hide_notification_contents: false})
|
||||
|
||||
{:ok, activity} =
|
||||
CommonAPI.post(user, %{
|
||||
|
|
|
|||
|
|
@ -200,20 +200,20 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|
|||
|
||||
assert %Pleroma.User.NotificationSetting{
|
||||
block_from_strangers: true,
|
||||
privacy_option: false
|
||||
hide_notification_contents: false
|
||||
} == user.notification_settings
|
||||
end
|
||||
|
||||
test "it updates notification privacy option", %{user: user, conn: conn} do
|
||||
test "it updates notification settings to enable hiding contents", %{user: user, conn: conn} do
|
||||
conn
|
||||
|> put("/api/pleroma/notification_settings", %{"privacy_option" => "1"})
|
||||
|> put("/api/pleroma/notification_settings", %{"hide_notification_contents" => "1"})
|
||||
|> json_response(:ok)
|
||||
|
||||
user = refresh_record(user)
|
||||
|
||||
assert %Pleroma.User.NotificationSetting{
|
||||
block_from_strangers: false,
|
||||
privacy_option: true
|
||||
hide_notification_contents: true
|
||||
} == user.notification_settings
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue