aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-04-30 11:55:19 +0200
committerRoger Braun <roger@rogerbraun.net>2017-04-30 11:55:19 +0200
commit62607f37dcf3ab149baa09fe144959a25322be69 (patch)
treeec2c2b22bf10bcb5a68676a78eff5add092411a1 /test
parent84027ff00b7fc63934f12129f84b5c7ee1d39248 (diff)
downloadpleroma-62607f37dcf3ab149baa09fe144959a25322be69.tar.gz
Federate object id for posts in ostatus.
This is because ostatus doens't have an id for the activities.
Diffstat (limited to 'test')
-rw-r--r--test/web/ostatus/activity_representer_test.exs6
-rw-r--r--test/web/ostatus/ostatus_test.exs2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/web/ostatus/activity_representer_test.exs b/test/web/ostatus/activity_representer_test.exs
index fd1b1598c..6344889b1 100644
--- a/test/web/ostatus/activity_representer_test.exs
+++ b/test/web/ostatus/activity_representer_test.exs
@@ -18,7 +18,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
expected = """
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
- <id>#{note_activity.data["id"]}</id>
+ <id>#{note_activity.data["object"]["id"]}</id>
<title>New note by #{user.nickname}</title>
<content type="html">#{note_activity.data["object"]["content"]}</content>
<published>#{inserted_at}</published>
@@ -53,14 +53,14 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
expected = """
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
- <id>#{answer.data["id"]}</id>
+ <id>#{answer.data["object"]["id"]}</id>
<title>New note by #{user.nickname}</title>
<content type="html">#{answer.data["object"]["content"]}</content>
<published>#{inserted_at}</published>
<updated>#{updated_at}</updated>
<ostatus:conversation>#{answer.data["context"]}</ostatus:conversation>
<link href="#{answer.data["context"]}" rel="ostatus:conversation" />
- <thr:in-reply-to ref="#{note.data["id"]}" />
+ <thr:in-reply-to ref="#{note.data["object"]["id"]}" />
"""
tuple = ActivityRepresenter.to_simple_form(answer, user)
diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs
index 5452e5888..3edd39911 100644
--- a/test/web/ostatus/ostatus_test.exs
+++ b/test/web/ostatus/ostatus_test.exs
@@ -7,8 +7,8 @@ defmodule Pleroma.Web.OStatusTest do
{:ok, [activity]} = OStatus.handle_incoming(incoming)
assert activity.data["type"] == "Create"
- assert activity.data["id"] == "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note"
assert activity.data["object"]["type"] == "Note"
+ assert activity.data["object"]["id"] == "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note"
assert activity.data["published"] == "2017-04-23T14:51:03+00:00"
assert activity.data["context"] == "tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b"
assert "http://pleroma.example.org:4000/users/lain3" in activity.data["to"]