From: Vivian Lim Date: Sun, 24 Jun 2018 06:05:54 +0000 (-0700) Subject: fixes- found that TwitterAPI.Controller adds .json suffix already X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=631600394694c1f90d0ecfc1432e46c1c54ca748;p=akkoma fixes- found that TwitterAPI.Controller adds .json suffix already --- 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]