added privacy option to push notifications
This commit is contained in:
parent
a52da55eb9
commit
04a8ffbe84
6 changed files with 76 additions and 40 deletions
|
|
@ -12,29 +12,10 @@ defmodule Pleroma.User.NotificationSettingTest do
|
|||
changeset =
|
||||
NotificationSetting.changeset(
|
||||
%NotificationSetting{},
|
||||
%{"privacy_option" => "name_only"}
|
||||
%{"privacy_option" => true}
|
||||
)
|
||||
|
||||
assert %Ecto.Changeset{valid?: true} = changeset
|
||||
end
|
||||
|
||||
test "returns invalid changeset when privacy option is incorrect" do
|
||||
changeset =
|
||||
NotificationSetting.changeset(
|
||||
%NotificationSetting{},
|
||||
%{"privacy_option" => "full_content"}
|
||||
)
|
||||
|
||||
assert %Ecto.Changeset{valid?: false} = changeset
|
||||
|
||||
assert [
|
||||
privacy_option:
|
||||
{"is invalid",
|
||||
[
|
||||
validation: :inclusion,
|
||||
enum: ["name_and_message", "name_only", "no_name_or_message"]
|
||||
]}
|
||||
] = changeset.errors
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue