Birthdays: birth_date --> birthday

This commit is contained in:
Alex Gleason 2022-01-22 13:21:55 -06:00
commit 66e8c6f90f
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
19 changed files with 92 additions and 92 deletions

View file

@ -1588,8 +1588,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
describe "create account with required birth date" do
setup %{conn: conn} do
clear_config([:instance, :birth_date_required], true)
clear_config([:instance, :birth_date_min_age], 18 * 365)
clear_config([:instance, :birthday_required], true)
clear_config([:instance, :birthday_min_age], 18 * 365)
app_token = insert(:oauth_token, user: nil)
@ -1602,7 +1602,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
end
test "creates an account if provided valid birth date", %{conn: conn} do
birth_date =
birthday =
Date.utc_today()
|> Date.add(-19 * 365)
|> Date.to_string()
@ -1612,7 +1612,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
email: "mkljczk@example.org",
password: "dupa.8",
agreement: true,
birth_date: birth_date
birthday: birthday
}
res =
@ -1635,7 +1635,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|> post("/api/v1/accounts", params)
assert json_response_and_validate_schema(res, 400) == %{
"error" => "{\"birth_date\":[\"can't be blank\"]}"
"error" => "{\"birthday\":[\"can't be blank\"]}"
}
end
end

View file

@ -370,24 +370,24 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
]
end
test "updates birth date", %{conn: conn, user: user} do
test "updates birth date", %{conn: conn} do
res =
patch(conn, "/api/v1/accounts/update_credentials", %{
"birth_date" => "2001-02-12"
"birthday" => "2001-02-12"
})
assert user_data = json_response_and_validate_schema(res, 200)
assert user_data["pleroma"]["birth_date"] == "2001-02-12"
assert user_data["pleroma"]["birthday"] == "2001-02-12"
end
test "updates the user's hide_birth_date status", %{conn: conn} do
test "updates the user's hide_birthday status", %{conn: conn} do
res =
patch(conn, "/api/v1/accounts/update_credentials", %{
"hide_birth_date" => true
"hide_birthday" => true
})
assert user_data = json_response_and_validate_schema(res, 200)
assert user_data["pleroma"]["hide_birth_date"] == true
assert user_data["pleroma"]["hide_birthday"] == true
end
test "emojis in fields labels", %{conn: conn} do

View file

@ -79,7 +79,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
ap_id: user.ap_id,
also_known_as: ["https://shitposter.zone/users/shp"],
background_image: "https://example.com/images/asuka_hospital.png",
birth_date: nil,
birthday: nil,
favicon: nil,
is_confirmed: true,
tags: [],
@ -182,7 +182,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
ap_id: user.ap_id,
also_known_as: [],
background_image: nil,
birth_date: nil,
birthday: nil,
favicon: nil,
is_confirmed: true,
tags: [],