diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-14 18:15:56 +0700 |
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-14 18:15:56 +0700 |
| commit | 5e2b491276d5cd8d90fddf219f7653d1c9b31ef3 (patch) | |
| tree | c7d10c01a9b17ba9c732cb43e2097bd26d67e915 /test/web/ostatus | |
| parent | 1557b99beb3b406572ef2d3baaabed1c9baeca1c (diff) | |
| parent | cdcdbd88da76f18c21da7f6f15a29883044902c8 (diff) | |
| download | pleroma-5e2b491276d5cd8d90fddf219f7653d1c9b31ef3.tar.gz pleroma-5e2b491276d5cd8d90fddf219f7653d1c9b31ef3.zip | |
Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
Diffstat (limited to 'test/web/ostatus')
| -rw-r--r-- | test/web/ostatus/activity_representer_test.exs | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/test/web/ostatus/activity_representer_test.exs b/test/web/ostatus/activity_representer_test.exs index a4bb68c4d..16ee02abb 100644 --- a/test/web/ostatus/activity_representer_test.exs +++ b/test/web/ostatus/activity_representer_test.exs @@ -67,37 +67,31 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do end test "a reply note" do - note = insert(:note_activity) - answer = insert(:note_activity) - object = answer.data["object"] - object = Map.put(object, "inReplyTo", note.data["object"]["id"]) - - data = %{answer.data | "object" => object} - answer = %{answer | data: data} - - note_object = Object.get_by_ap_id(note.data["object"]["id"]) + user = insert(:user) + note_object = insert(:note) + _note = insert(:note_activity, %{note: note_object}) + object = insert(:note, %{data: %{"inReplyTo" => note_object.data["id"]}}) + answer = insert(:note_activity, %{note: object}) Repo.update!( Object.change(note_object, %{data: Map.put(note_object.data, "external_url", "someurl")}) ) - user = User.get_cached_by_ap_id(answer.data["actor"]) - 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["object"]["id"]}</id> + <id>#{object.data["id"]}</id> <title>New note by #{user.nickname}</title> - <content type="html">#{answer.data["object"]["content"]}</content> - <published>#{answer.data["object"]["published"]}</published> - <updated>#{answer.data["object"]["published"]}</updated> + <content type="html">#{object.data["content"]}</content> + <published>#{object.data["published"]}</published> + <updated>#{object.data["published"]}</updated> <ostatus:conversation ref="#{answer.data["context"]}">#{answer.data["context"]}</ostatus:conversation> <link ref="#{answer.data["context"]}" rel="ostatus:conversation" /> <summary>2hu</summary> - <link type="application/atom+xml" href="#{answer.data["object"]["id"]}" rel="self" /> - <link type="text/html" href="#{answer.data["object"]["id"]}" rel="alternate" /> + <link type="application/atom+xml" href="#{object.data["id"]}" rel="self" /> + <link type="text/html" href="#{object.data["id"]}" rel="alternate" /> <category term="2hu"/> - <thr:in-reply-to ref="#{note.data["object"]["id"]}" href="someurl" /> + <thr:in-reply-to ref="#{note_object.data["id"]}" href="someurl" /> <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> <link name="2hu" rel="emoji" href="corndog.png" /> """ |
