aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-03-11 15:18:32 +0100
committerlain <lain@soykaf.club>2019-03-11 15:18:32 +0100
commit3474066f6dc98003583dcd8537028b515be0e126 (patch)
tree92000dca3b13571cd76aed35534fec6ca48401db /test
parent2c8deecdd2f75c6cdf1089e4266bedb8be55539c (diff)
downloadpleroma-3474066f6dc98003583dcd8537028b515be0e126.tar.gz
MastoAPI Accounts: Add fetching by nickname.
This is to make it easier for the frontends to handle domain.com/users/nickname urls.
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index 8a20eef2c..8e14e03c8 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -1064,6 +1064,17 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert %{"error" => "Can't find user"} = json_response(conn, 404)
end
+ test "account fetching also works nickname", %{conn: conn} do
+ user = insert(:user)
+
+ conn =
+ conn
+ |> get("/api/v1/accounts/#{user.nickname}")
+
+ assert %{"id" => id} = json_response(conn, 200)
+ assert id == user.id
+ end
+
test "media upload", %{conn: conn} do
file = %Plug.Upload{
content_type: "image/jpg",
@@ -1950,7 +1961,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|> json_response(200)
end
- test "accound_id is required", %{
+ test "account_id is required", %{
conn: conn,
reporter: reporter,
activity: activity