test: add status posting with OGP link preview test
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 28 Jan 2019 06:19:00 +0000 (06:19 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 28 Jan 2019 06:19:00 +0000 (06:19 +0000)
test/web/mastodon_api/mastodon_api_controller_test.exs

index 02a0eb228572912f3eda9a80dbf31d44eeaef1ad..1a5eb090c44e1a95fea85c7d19be9b6d964d4305 100644 (file)
@@ -136,6 +136,20 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
     assert Repo.get(Activity, id)
   end
 
+  test "posting a status with OGP link preview", %{conn: conn} do
+    user = insert(:user)
+
+    conn =
+      conn
+      |> assign(:user, user)
+      |> post("/api/v1/statuses", %{
+        "status" => "http://example.com/ogp"
+      })
+
+    assert %{"id" => id, "card" => %{"title" => "The Rock"}} = json_response(conn, 200)
+    assert Repo.get(Activity, id)
+  end
+
   test "posting a direct status", %{conn: conn} do
     user1 = insert(:user)
     user2 = insert(:user)