From 0f412cf6e68fcebda3e94b71b7f182af689748bf Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 24 Dec 2018 02:25:36 +0300 Subject: Create tombstone instead of object deletion --- test/web/mastodon_api/mastodon_api_controller_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index aec0f851c..6c6cc2a00 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) == nil + assert Repo.get(Activity, activity.id).data["type"] == "tombstone" end test "when you didn't create it", %{conn: conn} do -- cgit v1.2.3 From 18a4cbb244dbc188f5a391626fb98e3a53571318 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 24 Dec 2018 20:09:18 +0300 Subject: Capitalize "tombstone" --- test/web/mastodon_api/mastodon_api_controller_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 6c6cc2a00..f1baa9953 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" + assert Repo.get(Activity, activity.id).data["type"] == "Tombstone" end test "when you didn't create it", %{conn: conn} do -- cgit v1.2.3 From f75f707f6cf07c66a23ddbbe80a9b782a1ecb6f8 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Tue, 25 Dec 2018 03:00:06 +0300 Subject: Revert Activity tombstones, add ObjectTombstone struct --- .../mastodon_api/mastodon_api_controller_test.exs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs') 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 -- cgit v1.2.3 From aeb89bece60846d8311afd69d0ccfd1df80cbe65 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Tue, 25 Dec 2018 03:38:02 +0300 Subject: Remove unused test --- .../web/mastodon_api/mastodon_api_controller_test.exs | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 23f63372c..00cf52d69 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -308,25 +308,6 @@ 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 -- cgit v1.2.3