MastoAPI: Add accounts getting.
This commit is contained in:
parent
ad5001828e
commit
d168ef5a9e
3 changed files with 40 additions and 13 deletions
|
|
@ -198,4 +198,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|
|||
assert other_user.id == relationship["id"]
|
||||
end
|
||||
end
|
||||
|
||||
test "account fetching", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
|
||||
conn = conn
|
||||
|> get("/api/v1/accounts/#{user.id}")
|
||||
|
||||
assert %{"id" => id} = json_response(conn, 200)
|
||||
assert id == user.id
|
||||
|
||||
conn = build_conn()
|
||||
|> get("/api/v1/accounts/-1")
|
||||
|
||||
assert %{"error" => "Can't find user"} = json_response(conn, 404)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue