diff options
author | csaurus <csaurus@mailbox.org> | 2018-05-13 21:21:42 -0400 |
---|---|---|
committer | csaurus <csaurus@mailbox.org> | 2018-05-13 21:21:42 -0400 |
commit | 987a52cf6f987e5178194615637753c9619e2e5d (patch) | |
tree | 80b4190c8e367c30d161367bbfcccefd12d580e0 | |
parent | 2ce48c1a42b0e61958b513df610a81bb89b4254a (diff) | |
download | pleroma-987a52cf6f987e5178194615637753c9619e2e5d.tar.gz |
Post direct status test
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 16 |
1 files changed, 16 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 883ebc61e..71a6eed8d 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -124,6 +124,22 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert Repo.get(Activity, id) end + test "posting a direct status", %{conn: conn} do + user1 = insert(:user) + user2 = insert(:user) + content = "direct cofe @#{user2.nickname}" + + conn = + conn + |> assign(:user, user1) + |> post("api/v1/statuses", %{"status" => content, + "visibility" => "direct"}) + + assert %{"content" => content, "id" => id, "visibility" => "direct"} = json_response(conn, 200) + assert activity = Repo.get(Activity, id) + assert user2.follower_address not in activity.data["to"] + end + test "replying to a status", %{conn: conn} do user = insert(:user) |