summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2022-07-17 19:46:29 +0200
committermarcin mikołajczak <git@mkljczk.pl>2022-07-17 19:46:29 +0200
commitfb268c43786d1b058a6ec1b53939d4c122ac2af2 (patch)
treefc0348a23c083b9d0ea5c67360fbb2cc438c8b05 /test
parent3193f18cf35061188ead97bc0dc0a4e3a4986fa2 (diff)
downloadpleroma-fb268c43786d1b058a6ec1b53939d4c122ac2af2.tar.gz
pleroma-fb268c43786d1b058a6ec1b53939d4c122ac2af2.zip
Allow to unset birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/update_credentials_test.exs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs
index c2e4debc8..f5211a60e 100644
--- a/test/pleroma/web/mastodon_api/update_credentials_test.exs
+++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs
@@ -390,6 +390,20 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
assert user_data["source"]["pleroma"]["show_birthday"] == true
end
+ test "unsets birth date", %{conn: conn} do
+ patch(conn, "/api/v1/accounts/update_credentials", %{
+ "birthday" => "2001-02-12"
+ })
+
+ res =
+ patch(conn, "/api/v1/accounts/update_credentials", %{
+ "birthday" => ""
+ })
+
+ assert user_data = json_response_and_validate_schema(res, 200)
+ assert user_data["pleroma"]["birthday"] == nil
+ end
+
test "emojis in fields labels", %{conn: conn} do
fields = [
%{"name" => ":firefox:", "value" => "is best 2hu"},