diff options
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"}) | 
