diff options
author | Roger Braun <rbraun@Bobble.local> | 2017-09-13 17:36:02 +0200 |
---|---|---|
committer | Roger Braun <rbraun@Bobble.local> | 2017-09-13 17:36:02 +0200 |
commit | d168ef5a9eb4fc074b042a6dea6d7971d1972c06 (patch) | |
tree | 914116610735a11d785e88e7df62dc12a5bb6d34 /test | |
parent | ad5001828ec77cf9fdf4bfb93ad53568a66bfe8b (diff) | |
download | pleroma-d168ef5a9eb4fc074b042a6dea6d7971d1972c06.tar.gz pleroma-d168ef5a9eb4fc074b042a6dea6d7971d1972c06.zip |
MastoAPI: Add accounts getting.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
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 |