Fix specs.
authorlain <lain@soykaf.club>
Sun, 25 Feb 2018 15:40:37 +0000 (16:40 +0100)
committerlain <lain@soykaf.club>
Sun, 25 Feb 2018 15:40:37 +0000 (16:40 +0100)
lib/pleroma/user.ex
test/web/activity_pub/activity_pub_controller_test.exs

index 2ae01c2cc0a2270057d67ae6f1b1c25a40b2a022..b16c1e3423b311a0f7bac73b2a6b30e73538b700 100644 (file)
@@ -450,4 +450,5 @@ defmodule Pleroma.User do
   end
 
   def ap_enabled?(%User{info: info}), do: info["ap_enabled"]
+  def ap_enabled?(_), do: false
 end
index 957687c43143be04b17286ba28c741e76479a969..c8082cd03d443608f14252b4ce9a371d6bb14337 100644 (file)
@@ -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
@@ -38,9 +39,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
       conn = conn
       |> assign(:valid_signature, true)
       |> put_req_header("content-type", "application/activity+json")
-      |> post("/users/doesntmatter/inbox", data)
+      |> post("/inbox", data)
 
       assert "ok" == json_response(conn, 200)
+      :timer.sleep(500)
+      assert Activity.get_by_ap_id(data["id"])
     end
   end
 end