end
end
- describe "/api/pleroma/emoji" do
+ describe "/api/v1/pleroma/emoji" do
test "returns json with custom emoji with tags", %{conn: conn} do
emoji =
conn
- |> get("/api/pleroma/emoji")
+ |> get("/api/v1/pleroma/emoji")
|> json_response_and_validate_schema(200)
assert Enum.all?(emoji, fn
end
end
- describe "GET /api/pleroma/healthcheck" do
+ describe "GET /api/v1/pleroma/healthcheck" do
setup do: clear_config([:instance, :healthcheck])
test "returns 503 when healthcheck disabled", %{conn: conn} do
response =
conn
- |> get("/api/pleroma/healthcheck")
+ |> get("/api/v1/pleroma/healthcheck")
|> json_response_and_validate_schema(503)
assert response == %{}
system_info: fn -> %Pleroma.Healthcheck{healthy: true} end do
response =
conn
- |> get("/api/pleroma/healthcheck")
+ |> get("/api/v1/pleroma/healthcheck")
|> json_response_and_validate_schema(200)
assert %{
system_info: fn -> %Pleroma.Healthcheck{healthy: false} end do
response =
conn
- |> get("/api/pleroma/healthcheck")
+ |> get("/api/v1/pleroma/healthcheck")
|> json_response_and_validate_schema(503)
assert %{
new: fn -> "test_captcha" end do
resp =
conn
- |> get("/api/pleroma/captcha")
+ |> get("/api/v1/pleroma/captcha")
|> response(200)
assert resp == "\"test_captcha\""
conn =
conn
|> put_req_header("content-type", "multipart/form-data")
- |> post("/api/pleroma/change_email", %{password: "test", email: "cofe@foobar.com"})
+ |> post("/api/pleroma/change_email", %{
+ password: "test",
+ email: "cofe@foobar.com"
+ })
assert json_response_and_validate_schema(conn, 200) == %{"status" => "success"}
end
conn =
conn
|> put_req_header("content-type", "application/json")
- |> delete("/api/pleroma/aliases", %{alias: non_alias_user |> User.full_nickname()})
+ |> delete("/api/pleroma/aliases", %{
+ alias: non_alias_user |> User.full_nickname()
+ })
assert %{"error" => "Account has no such alias."} =
json_response_and_validate_schema(conn, 404)