diff options
| author | Maxim Filippov <colixer@gmail.com> | 2018-12-25 03:00:06 +0300 | 
|---|---|---|
| committer | Maxim Filippov <colixer@gmail.com> | 2018-12-25 03:00:06 +0300 | 
| commit | f75f707f6cf07c66a23ddbbe80a9b782a1ecb6f8 (patch) | |
| tree | db1a1cea51435c207eb0effbf25860124389d0cf /test/web | |
| parent | 2bbec33c7112ede3f93a7d35e9d5f3ac5a31ce05 (diff) | |
| download | pleroma-f75f707f6cf07c66a23ddbbe80a9b782a1ecb6f8.tar.gz pleroma-f75f707f6cf07c66a23ddbbe80a9b782a1ecb6f8.zip | |
Revert Activity tombstones, add ObjectTombstone struct
Diffstat (limited to 'test/web')
| -rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 2 | ||||
| -rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 21 | ||||
| -rw-r--r-- | test/web/ostatus/incoming_documents/delete_handling_test.exs | 4 | 
3 files changed, 23 insertions, 4 deletions
| diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 8ab240dff..0428e052d 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -363,7 +363,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do        {:ok, %Activity{local: false}} = Transmogrifier.handle_incoming(data) -      assert Repo.get(Activity, activity.id).data["type"] == "Tombstone" +      refute Repo.get(Activity, activity.id)      end      test "it fails for incoming deletes with spoofed origin" do diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index f1baa9953..23f63372c 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -292,7 +292,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do        assert %{} = json_response(conn, 200) -      assert Repo.get(Activity, activity.id).data["type"] == "Tombstone" +      refute Repo.get(Activity, activity.id)      end      test "when you didn't create it", %{conn: conn} do @@ -308,6 +308,25 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do        assert Repo.get(Activity, activity.id) == activity      end + +    # test "404 when making an attempt to get it" do +    #   activity = insert(:note_activity) +    #   author = User.get_by_ap_id(activity.data["actor"]) + +    #   conn = +    #     conn +    #     |> assign(:user, author) +    #     |> delete("/api/v1/statuses/#{activity.id}") + +    #   assert %{} = json_response(conn, 200) + +    #   conn = +    #     build_conn() +    #     |> assign(:user, author) +    #     |> get("/api/v1/statuses/#{activity.id}") + +    #   assert %{} = json_response(conn, 200) +    # end    end    describe "filters" do diff --git a/test/web/ostatus/incoming_documents/delete_handling_test.exs b/test/web/ostatus/incoming_documents/delete_handling_test.exs index 4e9c0f90f..c8fbff6cc 100644 --- a/test/web/ostatus/incoming_documents/delete_handling_test.exs +++ b/test/web/ostatus/incoming_documents/delete_handling_test.exs @@ -23,8 +23,8 @@ defmodule Pleroma.Web.OStatus.DeleteHandlingTest do        {:ok, [delete]} = OStatus.handle_incoming(incoming) -      assert Repo.get(Activity, note.id).data["type"] == "Tombstone" -      assert Repo.get(Activity, like.id).data["type"] == "Tombstone" +      refute Repo.get(Activity, note.id) +      refute Repo.get(Activity, like.id)        assert Object.get_by_ap_id(note.data["object"]["id"]).data["type"] == "Tombstone"        assert Repo.get(Activity, second_note.id)        assert Object.get_by_ap_id(second_note.data["object"]["id"]) | 
