Clean up account aliases

This commit is contained in:
Alex Gleason 2020-08-07 16:48:03 -05:00
commit 4af1b80381
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
17 changed files with 47 additions and 222 deletions

View file

@ -216,6 +216,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
assert user_data["display_name"] == "markorepairs"
end
test "updates the user's AKAs", %{conn: conn} do
conn =
patch(conn, "/api/v1/accounts/update_credentials", %{
"also_known_as" => ["https://mushroom.kingdom/users/mario"]
})
assert user_data = json_response_and_validate_schema(conn, 200)
assert user_data["pleroma"]["also_known_as"] == ["https://mushroom.kingdom/users/mario"]
end
test "updates the user's avatar", %{user: user, conn: conn} do
new_avatar = %Plug.Upload{
content_type: "image/jpg",

View file

@ -38,7 +38,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
inserted_at: ~N[2017-08-15 15:47:06.597036],
emoji: %{"karjalanpiirakka" => "/file.png"},
raw_bio: "valid html. a\nb\nc\nd\nf '&<>\"",
ap_aliases: ["https://shitposter.zone/users/shp"]
also_known_as: ["https://shitposter.zone/users/shp"]
})
expected = %{
@ -78,7 +78,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
},
pleroma: %{
ap_id: user.ap_id,
ap_aliases: ["https://shitposter.zone/users/shp"],
also_known_as: ["https://shitposter.zone/users/shp"],
background_image: "https://example.com/images/asuka_hospital.png",
favicon:
"https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png",
@ -174,7 +174,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
},
pleroma: %{
ap_id: user.ap_id,
ap_aliases: [],
also_known_as: [],
background_image: nil,
favicon:
"https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png",