summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/twitter_api_controller_test.exs
diff options
context:
space:
mode:
authorSyldexia <syldexia@ofthewi.red>2018-05-13 14:24:15 +0100
committerSyldexia <syldexia@ofthewi.red>2018-05-13 14:36:02 +0100
commit5bfb7b4ce6c23f84c27643e9871b78b867f86b7e (patch)
treee151c2eaa49ccf95b7c87e5496147d383bea5bd7 /test/web/twitter_api/twitter_api_controller_test.exs
parenta16117225f9a4da9da08013ae256d8ac02ee3ec5 (diff)
downloadpleroma-5bfb7b4ce6c23f84c27643e9871b78b867f86b7e.tar.gz
pleroma-5bfb7b4ce6c23f84c27643e9871b78b867f86b7e.zip
Moved account deletion stuff to somewhere that hopefully makes more sense
Diffstat (limited to 'test/web/twitter_api/twitter_api_controller_test.exs')
-rw-r--r--test/web/twitter_api/twitter_api_controller_test.exs17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs
index a9350d189..170dda145 100644
--- a/test/web/twitter_api/twitter_api_controller_test.exs
+++ b/test/web/twitter_api/twitter_api_controller_test.exs
@@ -801,11 +801,11 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
assert user.bio == "Hello,<br>World! I<br> am a test."
end
- describe "POST /api/account/delete_account" do
+ describe "POST /api/pleroma/delete_account" do
setup [:valid_user]
test "without credentials", %{conn: conn} do
- conn = post(conn, "/api/account/delete_account")
+ conn = post(conn, "/api/pleroma/delete_account")
assert json_response(conn, 403) == %{"error" => "Invalid credentials."}
end
@@ -813,23 +813,16 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
conn =
conn
|> with_credentials(current_user.nickname, "test")
- |> post("/api/account/delete_account", %{
- "password" => ""
- })
+ |> post("/api/pleroma/delete_account", %{"password" => "hi"})
- assert json_response(conn, 403) == %{
- "error" => "Invalid password.",
- "request" => "/api/account/delete_account"
- }
+ assert json_response(conn, 200) == %{"error" => "Invalid password."}
end
test "with credentials and valid password", %{conn: conn, user: current_user} do
conn =
conn
|> with_credentials(current_user.nickname, "test")
- |> post("/api/account/delete_account", %{
- "password" => "test"
- })
+ |> post("/api/pleroma/delete_account", %{"password" => "test"})
assert json_response(conn, 200) == %{"status" => "success"}
fetched_user = Repo.get(User, current_user.id)