diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-10-30 19:25:32 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-10-30 19:25:32 +0100 |
commit | f23edd2d6b67ee30ccd16b7a27d9e07a9f928574 (patch) | |
tree | 7f8516e81ff6d1aa188904dab044fec01488bc70 /test | |
parent | 261ec824515c1de6d93ad1c4ca7d3cf73faa58a4 (diff) | |
parent | 502cb38cd69f9f8c15a0ee597584364f9d36bdf1 (diff) | |
download | pleroma-f23edd2d6b67ee30ccd16b7a27d9e07a9f928574.tar.gz |
Merge branch 'feld/pleroma-feld-mastodon-usersearch' into develop
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 21 |
1 files changed, 21 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 56888140d..485a0d029 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -281,6 +281,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> post("/api/v1/accounts/#{other_user.id}/unfollow") assert %{"id" => id, "following" => false} = json_response(conn, 200) + + user = Repo.get(User, user.id) + conn = build_conn() + |> assign(:user, user) + |> post("/api/v1/follows", %{"uri" => other_user.nickname}) + + assert %{"id" => id} = json_response(conn, 200) + assert id == other_user.id end test "unimplemented block/mute endpoints" do @@ -311,6 +319,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do end) end + test "account seach", %{conn: conn} do + user = insert(:user) + user_two = insert(:user, %{nickname: "shp@shitposter.club"}) + user_three = insert(:user, %{nickname: "shp@heldscal.la", name: "I love 2hu"}) + + conn = conn + |> assign(:user, user) + |> get("/api/v1/accounts/search", %{"q" => "2hu"}) + + assert [account] = json_response(conn, 200) + assert account["id"] == user_three.id + end + test "search", %{conn: conn} do user = insert(:user) user_two = insert(:user, %{nickname: "shp@shitposter.club"}) |