1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-18 02:49:18 +00:00

Merge branch 'revert-651f2695' into 'develop'

Revert "Merge branch 'avatar-removing' into 'develop'"

See merge request pleroma/pleroma!2710
This commit is contained in:
lain 2020-07-01 09:18:02 +00:00
commit d889c9ca70

View file

@ -216,20 +216,10 @@ test "updates the user's avatar", %{user: user, conn: conn} do
filename: "an_image.jpg"
}
res =
conn
|> patch("/api/v1/accounts/update_credentials", %{"avatar" => new_avatar})
conn = patch(conn, "/api/v1/accounts/update_credentials", %{"avatar" => new_avatar})
assert user_response = json_response_and_validate_schema(res, 200)
assert user_response = json_response_and_validate_schema(conn, 200)
assert user_response["avatar"] != User.avatar_url(user)
# Also removes it
res =
conn
|> patch("/api/v1/accounts/update_credentials", %{"avatar" => nil})
assert user_response = json_response_and_validate_schema(res, 200)
assert user_response["avatar"] == User.avatar_url(user)
end
test "updates the user's banner", %{user: user, conn: conn} do
@ -239,21 +229,10 @@ test "updates the user's banner", %{user: user, conn: conn} do
filename: "an_image.jpg"
}
res =
conn
|> patch("/api/v1/accounts/update_credentials", %{"header" => new_header})
conn = patch(conn, "/api/v1/accounts/update_credentials", %{"header" => new_header})
assert user_response = json_response_and_validate_schema(res, 200)
assert user_response = json_response_and_validate_schema(conn, 200)
assert user_response["header"] != User.banner_url(user)
# Also removes it
res =
conn
|> patch("/api/v1/accounts/update_credentials", %{"header" => nil})
assert user_response = json_response_and_validate_schema(res, 200)
assert user_response["header"] == User.banner_url(user)
end
test "updates the user's background", %{conn: conn} do
@ -263,25 +242,13 @@ test "updates the user's background", %{conn: conn} do
filename: "an_image.jpg"
}
res =
conn
|> patch("/api/v1/accounts/update_credentials", %{
conn =
patch(conn, "/api/v1/accounts/update_credentials", %{
"pleroma_background_image" => new_header
})
assert user_response = json_response_and_validate_schema(res, 200)
assert user_response = json_response_and_validate_schema(conn, 200)
assert user_response["pleroma"]["background_image"]
# Also removes it
res =
conn
|> patch("/api/v1/accounts/update_credentials", %{
"pleroma_background_image" => nil
})
assert user_response = json_response_and_validate_schema(res, 200)
refute user_response["pleroma"]["background_image"]
end
test "requires 'write:accounts' permission" do