X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fcommon_api%2Fcommon_api_test.exs;h=9e626fb9e688eb9d538e9e88ca9dd49e7da9fb92;hb=814c3e51714b2a7de30ed751a6aef361fc712807;hp=46ffd2888a198c8b7232407e18399db531608686;hpb=0f0acc740d30c47d093f27875d4decf0693b2845;p=akkoma diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 46ffd2888..9e626fb9e 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -98,6 +98,18 @@ defmodule Pleroma.Web.CommonAPITest do end end + describe "unblocking" do + test "it works even without an existing block activity" do + blocked = insert(:user) + blocker = insert(:user) + User.block(blocker, blocked) + + assert User.blocks?(blocker, blocked) + assert {:ok, :no_activity} == CommonAPI.unblock(blocker, blocked) + refute User.blocks?(blocker, blocked) + end + end + describe "deletion" do test "it works with pruned objects" do user = insert(:user) @@ -904,10 +916,10 @@ defmodule Pleroma.Web.CommonAPITest do {:ok, activity} = CommonAPI.listen(user, %{ - "title" => "lain radio episode 1", - "album" => "lain radio", - "artist" => "lain", - "length" => 180_000 + title: "lain radio episode 1", + album: "lain radio", + artist: "lain", + length: 180_000 }) object = Object.normalize(activity) @@ -922,11 +934,11 @@ defmodule Pleroma.Web.CommonAPITest do {:ok, activity} = CommonAPI.listen(user, %{ - "title" => "lain radio episode 1", - "album" => "lain radio", - "artist" => "lain", - "length" => 180_000, - "visibility" => "private" + title: "lain radio episode 1", + album: "lain radio", + artist: "lain", + length: 180_000, + visibility: "private" }) object = Object.normalize(activity)