diff options
author | sxsdv1 <sxsdv1@gmail.com> | 2018-12-29 18:21:45 +0100 |
---|---|---|
committer | sxsdv1 <sxsdv1@gmail.com> | 2018-12-30 12:01:39 +0100 |
commit | 569bad821006add1719123f6e2830f23542921d2 (patch) | |
tree | c221080fd786f84284e28cf76bf778a06eed51b2 /test | |
parent | 26dc2dddab6103a3e6e44a3c7ba097283302fc2a (diff) | |
download | pleroma-569bad821006add1719123f6e2830f23542921d2.tar.gz pleroma-569bad821006add1719123f6e2830f23542921d2.zip |
Create activity when client posts to outbox
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 589645dd6..cb95e0e09 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -178,6 +178,20 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert json_response(conn, 403) end + + test "it inserts an incoming activity into the database", %{conn: conn} do + data = File.read!("test/fixtures/activitypub-client-post-activity.json") |> Poison.decode!() + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> put_req_header("content-type", "application/activity+json") + |> post("/users/#{user.nickname}/outbox", data) + + result = json_response(conn, 201) + assert Activity.get_by_ap_id(result["id"]) + end end describe "/users/:nickname/followers" do |