From d168ef5a9eb4fc074b042a6dea6d7971d1972c06 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 13 Sep 2017 17:36:02 +0200 Subject: MastoAPI: Add accounts getting. --- test/web/mastodon_api/mastodon_api_controller_test.exs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 52415bb50..fcb3f80f5 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -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 -- cgit v1.2.3