diff options
author | Roger Braun <rbraun@Bobble.local> | 2017-09-13 15:55:10 +0200 |
---|---|---|
committer | Roger Braun <rbraun@Bobble.local> | 2017-09-13 15:55:10 +0200 |
commit | 49929321c761cf389d42ca52d88dc8ec09a375cc (patch) | |
tree | 2b1617202f4475a48d9d46a9773ea262d96b5ce4 /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | f03524805fdc95b9681f59a68a1edb2885f2e7ba (diff) | |
download | pleroma-49929321c761cf389d42ca52d88dc8ec09a375cc.tar.gz pleroma-49929321c761cf389d42ca52d88dc8ec09a375cc.zip |
Add relationships to masto api.
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 17 |
1 files changed, 17 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 e87430d3f..52415bb50 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -181,4 +181,21 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert id == note_two.id end end + + describe "user relationships" do + test "returns the relationships for the current user", %{conn: conn} do + user = insert(:user) + other_user = insert(:user) + + {:ok, user} = User.follow(user, other_user) + + conn = conn + |> assign(:user, user) + |> get("/api/v1/accounts/relationships", %{"id" => [other_user.id]}) + + assert [relationship] = json_response(conn, 200) + + assert other_user.id == relationship["id"] + end + end end |