diff options
| author | Mark Felder <feld@FreeBSD.org> | 2019-06-03 09:12:17 -0500 | 
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2019-06-03 09:12:17 -0500 | 
| commit | f4e2595592ccca6cedd64669baef7bdd2a6547d0 (patch) | |
| tree | 6806a79345c7599b0d436df8b6c46e75b54d1292 /test/web/ostatus | |
| parent | 3c4cab9be18ff543d025177b418ddd0b16050e68 (diff) | |
| parent | 9789e000b05621435dc0c03833f564481e0b80e6 (diff) | |
| download | pleroma-f4e2595592ccca6cedd64669baef7bdd2a6547d0.tar.gz pleroma-f4e2595592ccca6cedd64669baef7bdd2a6547d0.zip | |
Merge branch 'develop' into update-oauth-template
Diffstat (limited to 'test/web/ostatus')
| -rw-r--r-- | test/web/ostatus/activity_representer_test.exs | 30 | ||||
| -rw-r--r-- | test/web/ostatus/ostatus_test.exs | 6 | 
2 files changed, 15 insertions, 21 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" />      """ diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs index 2916caf8d..f6be16862 100644 --- a/test/web/ostatus/ostatus_test.exs +++ b/test/web/ostatus/ostatus_test.exs @@ -355,7 +355,7 @@ defmodule Pleroma.Web.OStatusTest do        {:ok, user} = OStatus.find_or_make_user(uri) -      user = Pleroma.User.get_cached_by_id(user.id) +      user = User.get_cached_by_id(user.id)        assert user.name == "Constance Variable"        assert user.nickname == "lambadalambda@social.heldscal.la"        assert user.local == false @@ -374,7 +374,7 @@ defmodule Pleroma.Web.OStatusTest do        {:ok, user} = OStatus.find_or_make_user(uri)        assert user.info == -               %Pleroma.User.Info{ +               %User.Info{                   id: user.info.id,                   ap_enabled: false,                   background: %{}, @@ -407,7 +407,7 @@ defmodule Pleroma.Web.OStatusTest do        {:ok, user} = OStatus.find_or_make_user(uri)        old_name = user.name        old_bio = user.bio -      change = Ecto.Changeset.change(user, %{avatar: nil, bio: nil, old_name: nil}) +      change = Ecto.Changeset.change(user, %{avatar: nil, bio: nil, name: nil})        {:ok, user} = Repo.update(change)        refute user.avatar | 
