projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/develop' into conversations_three
[akkoma]
/
test
/
web
/
activity_pub
/
activity_pub_test.exs
diff --git
a/test/web/activity_pub/activity_pub_test.exs
b/test/web/activity_pub/activity_pub_test.exs
index f8e987e5827499040a7187a2ce335a0f08eb2a4d..15276ba7b193f0c02010b52f76c3842d06ba16e0 100644
(file)
--- a/
test/web/activity_pub/activity_pub_test.exs
+++ b/
test/web/activity_pub/activity_pub_test.exs
@@
-130,9
+130,15
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
test "doesn't drop activities with content being null" do
end
test "doesn't drop activities with content being null" do
+ user = insert(:user)
+
data = %{
data = %{
- "ok" => true,
+ "actor" => user.ap_id,
+ "to" => [],
"object" => %{
"object" => %{
+ "actor" => user.ap_id,
+ "to" => [],
+ "type" => "Note",
"content" => nil
}
}
"content" => nil
}
}
@@
-148,8
+154,17
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
test "inserts a given map into the activity database, giving it an id if it has none." do
end
test "inserts a given map into the activity database, giving it an id if it has none." do
+ user = insert(:user)
+
data = %{
data = %{
- "ok" => true
+ "actor" => user.ap_id,
+ "to" => [],
+ "object" => %{
+ "actor" => user.ap_id,
+ "to" => [],
+ "type" => "Note",
+ "content" => "hey"
+ }
}
{:ok, %Activity{} = activity} = ActivityPub.insert(data)
}
{:ok, %Activity{} = activity} = ActivityPub.insert(data)
@@
-159,9
+174,16
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
given_id = "bla"
data = %{
given_id = "bla"
data = %{
- "ok" => true,
"id" => given_id,
"id" => given_id,
- "context" => "blabla"
+ "actor" => user.ap_id,
+ "to" => [],
+ "context" => "blabla",
+ "object" => %{
+ "actor" => user.ap_id,
+ "to" => [],
+ "type" => "Note",
+ "content" => "hey"
+ }
}
{:ok, %Activity{} = activity} = ActivityPub.insert(data)
}
{:ok, %Activity{} = activity} = ActivityPub.insert(data)
@@
-172,10
+194,16
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
test "adds a context when none is there" do
end
test "adds a context when none is there" do
+ user = insert(:user)
+
data = %{
data = %{
- "id" => "some_id",
+ "actor" => user.ap_id,
+ "to" => [],
"object" => %{
"object" => %{
- "id" => "object_id"
+ "actor" => user.ap_id,
+ "to" => [],
+ "type" => "Note",
+ "content" => "hey"
}
}
}
}
@@
-188,10
+216,16
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
test "adds an id to a given object if it lacks one and is a note and inserts it to the object database" do
end
test "adds an id to a given object if it lacks one and is a note and inserts it to the object database" do
+ user = insert(:user)
+
data = %{
data = %{
+ "actor" => user.ap_id,
+ "to" => [],
"object" => %{
"object" => %{
+ "actor" => user.ap_id,
+ "to" => [],
"type" => "Note",
"type" => "Note",
- "
ok" => true
+ "
content" => "hey"
}
}
}
}