summaryrefslogtreecommitdiff
path: root/test/object_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/object_test.exs')
-rw-r--r--test/object_test.exs31
1 files changed, 2 insertions, 29 deletions
diff --git a/test/object_test.exs b/test/object_test.exs
index ab6431012..a820a34ee 100644
--- a/test/object_test.exs
+++ b/test/object_test.exs
@@ -5,7 +5,8 @@
defmodule Pleroma.ObjectTest do
use Pleroma.DataCase
import Pleroma.Factory
- alias Pleroma.{Repo, Object}
+ alias Pleroma.Repo
+ alias Pleroma.Object
test "returns an object by it's AP id" do
object = insert(:note)
@@ -57,32 +58,4 @@ defmodule Pleroma.ObjectTest do
assert cached_object.data["type"] == "Tombstone"
end
end
-
- describe "insert_or_get" do
- test "inserting the same object twice (by id) just returns the original object" do
- data = %{data: %{"id" => Ecto.UUID.generate()}}
- cng = Object.change(%Object{}, data)
- {:ok, object} = Object.insert_or_get(cng)
- {:ok, second_object} = Object.insert_or_get(cng)
-
- Cachex.clear(:object_cache)
- {:ok, third_object} = Object.insert_or_get(cng)
-
- assert object == second_object
- assert object == third_object
- end
- end
-
- describe "create" do
- test "inserts an object for a given data set" do
- data = %{"id" => Ecto.UUID.generate()}
-
- {:ok, object} = Object.create(data)
- assert object.data["id"] == data["id"]
-
- # Works when doing it twice.
- {:ok, object} = Object.create(data)
- assert object.data["id"] == data["id"]
- end
- end
end