Update Copyrights
[akkoma] / test / bookmark_test.exs
index 3be148023eb9079539b75f13b7a4ce1e50a4afc1..021f79322e5ae923e1b00411ec48859b87c2be0b 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.BookmarkTest do
   use Pleroma.DataCase
   import Pleroma.Factory
@@ -34,4 +38,19 @@ defmodule Pleroma.BookmarkTest do
       {:ok, _deleted_bookmark} = Bookmark.destroy(user.id, activity.id)
     end
   end
+
+  describe "get/2" do
+    test "gets a bookmark" do
+      user = insert(:user)
+
+      {:ok, activity} =
+        CommonAPI.post(user, %{
+          "status" =>
+            "Scientists Discover The Secret Behind Tenshi Eating A Corndog Being So Cute – Science Daily"
+        })
+
+      {:ok, bookmark} = Bookmark.create(user.id, activity.id)
+      assert bookmark == Bookmark.get(user.id, activity.id)
+    end
+  end
 end