diff options
author | Francis Dinh <normandy@firemail.cc> | 2018-05-17 23:53:34 -0400 |
---|---|---|
committer | Francis Dinh <normandy@firemail.cc> | 2018-05-17 23:53:34 -0400 |
commit | e6dc15b96cb971836211a1e57be1756936456c17 (patch) | |
tree | cc5310fb347c707257339eedb88ebdac79c2b42c /test | |
parent | d8c842a7713ab2c9dd49bdabfad4f5a1b6120fcf (diff) | |
download | pleroma-e6dc15b96cb971836211a1e57be1756936456c17.tar.gz pleroma-e6dc15b96cb971836211a1e57be1756936456c17.zip |
Undo formatting in user.ex
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/mastodon-unfollow-activity.json | 33 | ||||
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 24 |
2 files changed, 0 insertions, 57 deletions
diff --git a/test/fixtures/mastodon-unfollow-activity.json b/test/fixtures/mastodon-unfollow-activity.json deleted file mode 100644 index 022b47acd..000000000 --- a/test/fixtures/mastodon-unfollow-activity.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "@context": [ - "https://www.w3.org/ns/activitystreams", - "https://w3id.org/security/v1", - { - "toot": "http://joinmastodon.org/ns#", - "sensitive": "as:sensitive", - "ostatus": "http://ostatus.org#", - "movedTo": "as:movedTo", - "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", - "inReplyToAtomUri": "ostatus:inReplyToAtomUri", - "conversation": "ostatus:conversation", - "atomUri": "ostatus:atomUri", - "Hashtag": "as:Hashtag", - "Emoji": "toot:Emoji" - } - ], - "signature": { - "type": "RsaSignature2017", - "signatureValue": "Kn1/UkAQGJVaXBfWLAHcnwHg8YMAUqlEaBuYLazAG+pz5hqivsyrBmPV186Xzr+B4ZLExA9+SnOoNx/GOz4hBm0kAmukNSILAsUd84tcJ2yT9zc1RKtembK4WiwOw7li0+maeDN0HaB6t+6eTqsCWmtiZpprhXD8V1GGT8yG7X24fQ9oFGn+ng7lasbcCC0988Y1eGqNe7KryxcPuQz57YkDapvtONzk8gyLTkZMV4De93MyRHq6GVjQVIgtiYabQAxrX6Q8C+4P/jQoqdWJHEe+MY5JKyNaT/hMPt2Md1ok9fZQBGHlErk22/zy8bSN19GdG09HmIysBUHRYpBLig==", - "creator": "http://mastodon.example.org/users/admin#main-key", - "created": "2018-02-17T13:29:31Z" - }, - "type": "Undo", - "object": { - "type": "Follow", - "object": "http://localtesting.pleroma.lol/users/lain", - "nickname": "lain", - "id": "http://mastodon.example.org/users/admin#follows/2", - "actor": "http://mastodon.example.org/users/admin" - }, - "actor": "http://mastodon.example.org/users/admin" -} diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 8ed7147f4..a3408da9d 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -260,30 +260,6 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do assert data["object"]["id"] == "http://mastodon.example.org/users/admin/statuses/99542391527669785/activity" end - - test "it works for incomming unfollows" do - user = insert(:user) - - follow_data = - File.read!("test/fixtures/mastodon-follow-activity.json") - |> Poison.decode!() - |> Map.put("object", user.ap_id) - - {:ok, %Activity{data: _, local: false}} = Transmogrifier.handle_incoming(follow_data) - - data = - File.read!("test/fixtures/mastodon-unfollow-activity.json") - |> Poison.decode!() - |> Map.put("object", follow_data) - - {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) - - assert data["type"] == "Undo" - assert data["object"]["type"] == "Follow" - assert data["actor"] == "http://mastodon.example.org/users/admin" - - refute User.following?(User.get_by_ap_id(data["actor"]), user) - end end describe "prepare outgoing" do |