X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Factivity_pub%2Factivity_pub_controller_test.exs;h=c8082cd03d443608f14252b4ce9a371d6bb14337;hb=47a5cc0dd9a1afeb81a884ee91cab48f97de82f8;hp=21ed28cf28b82ba7d6c1fb63350358131031d579;hpb=e2e636503525f4e295430ddb71007ab8e851e856;p=akkoma diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 21ed28cf2..c8082cd03 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -3,6 +3,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do import Pleroma.Factory alias Pleroma.Web.ActivityPub.{UserView, ObjectView} alias Pleroma.{Repo, User} + alias Pleroma.Activity describe "/users/:nickname" do test "it returns a json representation of the user", %{conn: conn} do @@ -32,8 +33,17 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do end describe "/users/:nickname/inbox" do - test "it inserts an incoming activity into the database" do - assert false + test "it inserts an incoming activity into the database", %{conn: conn} do + data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode! + + conn = conn + |> assign(:valid_signature, true) + |> put_req_header("content-type", "application/activity+json") + |> post("/inbox", data) + + assert "ok" == json_response(conn, 200) + :timer.sleep(500) + assert Activity.get_by_ap_id(data["id"]) end end end