From 631600394694c1f90d0ecfc1432e46c1c54ca748 Mon Sep 17 00:00:00 2001 From: Vivian Lim Date: Sat, 23 Jun 2018 23:05:54 -0700 Subject: [PATCH] fixes- found that TwitterAPI.Controller adds .json suffix already --- lib/pleroma/web/router.ex | 2 +- .../twitter_api_controller_test.exs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index a502ba4d5..b65850aaa 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -269,7 +269,7 @@ defmodule Pleroma.Web.Router do get("/friendships/no_retweets/ids", TwitterAPI.Controller, :empty_array) get("/mutes/users/ids", TwitterAPI.Controller, :empty_array) - get("/qvitter/mutes.json", TwitterAPI.Controller, :empty_array) + get("/qvitter/mutes", TwitterAPI.Controller, :empty_array) get("/externalprofile/show", TwitterAPI.Controller, :external_profile) end diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 806227110..edc8cbff8 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -491,6 +491,25 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do end end + describe "GET /api/qvitter/mutes.json" do + setup [:valid_user] + + test "unimplemented mutes without valid credentials", %{conn: conn} do + conn = get(conn, "/api/qvitter/mutes.json") + assert json_response(conn, 403) == %{"error" => "Invalid credentials."} + end + + test "unimplemented mutes with credentials", %{conn: conn, user: current_user} do + conn = + conn + |> with_credentials(current_user.nickname, "test") + |> get("/api/qvitter/mutes.json") + current_user = Repo.get(User, current_user.id) + + assert "[]" = json_response(conn, 200) + end + end + describe "POST /api/favorites/create/:id" do setup [:valid_user]