X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fbookmark_test.exs;h=2726fe7cd02f3f29428ef52d2a37a63276d66369;hb=f3a1f9c3bbb7321876a09b3846b5e10ecf4af94f;hp=3be148023eb9079539b75f13b7a4ce1e50a4afc1;hpb=002ea343f8c6dc9669bce91942f835a2c7cc6ae7;p=akkoma diff --git a/test/bookmark_test.exs b/test/bookmark_test.exs index 3be148023..2726fe7cd 100644 --- a/test/bookmark_test.exs +++ b/test/bookmark_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2020 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.BookmarkTest do use Pleroma.DataCase import Pleroma.Factory @@ -7,7 +11,7 @@ defmodule Pleroma.BookmarkTest do describe "create/2" do test "with valid params" do user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{"status" => "Some cool information"}) + {:ok, activity} = CommonAPI.post(user, %{status: "Some cool information"}) {:ok, bookmark} = Bookmark.create(user.id, activity.id) assert bookmark.user_id == user.id assert bookmark.activity_id == activity.id @@ -28,10 +32,25 @@ defmodule Pleroma.BookmarkTest do test "with valid params" do user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{"status" => "Some cool information"}) + {:ok, activity} = CommonAPI.post(user, %{status: "Some cool information"}) {:ok, _bookmark} = Bookmark.create(user.id, activity.id) {: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