aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-05-07 20:13:10 +0200
committerRoger Braun <roger@rogerbraun.net>2017-05-07 20:13:10 +0200
commitdb08498a9ff9166afc5cf4df1afe55e96a74b4a3 (patch)
treeecfda1f9ed3563e8172af435e77c5bedc08f4b2b /test
parent4f9328c622d4d97b339006443073b22b2668c4da (diff)
downloadpleroma-db08498a9ff9166afc5cf4df1afe55e96a74b4a3.tar.gz
Prevent double insertions.
Diffstat (limited to 'test')
-rw-r--r--test/web/activity_pub/activity_pub_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs
index a9a6e1364..2e361ad38 100644
--- a/test/web/activity_pub/activity_pub_test.exs
+++ b/test/web/activity_pub/activity_pub_test.exs
@@ -7,6 +7,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
import Pleroma.Factory
describe "insertion" do
+ test "returns the activity if one with the same id is already in" do
+ activity = insert(:note_activity)
+ {:ok, new_activity}= ActivityPub.insert(activity.data)
+
+ assert activity == new_activity
+ end
+
test "inserts a given map into the activity database, giving it an id if it has none." do
data = %{
"ok" => true