diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-09-14 16:11:44 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-09-14 16:11:44 +0300 |
commit | 6bcedb693c47fcef44ff3b4412629d1c50c2a1c7 (patch) | |
tree | 0420581ba993b70cb957c261cb83ef90597ddeb4 /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | c3f00447afc67b460e63b531e4f2432bfaa37bdb (diff) | |
parent | a9b78f55e3561eec3cd125f030d2dd6ec338d406 (diff) | |
download | pleroma-6bcedb693c47fcef44ff3b4412629d1c50c2a1c7.tar.gz pleroma-6bcedb693c47fcef44ff3b4412629d1c50c2a1c7.zip |
[#1149] Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
# Conflicts:
# docs/config.md
# mix.lock
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 9269e1e09..22da3e605 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -745,6 +745,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert id == to_string(activity.id) end + test "get statuses by IDs", %{conn: conn} do + %{id: id1} = insert(:note_activity) + %{id: id2} = insert(:note_activity) + + query_string = "ids[]=#{id1}&ids[]=#{id2}" + conn = get(conn, "/api/v1/statuses/?#{query_string}") + + assert [%{"id" => ^id1}, %{"id" => ^id2}] = json_response(conn, :ok) + end + describe "deleting a status" do test "when you created it", %{conn: conn} do activity = insert(:note_activity) @@ -3957,13 +3967,15 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do Config.put([:suggestions, :enabled], true) Config.put([:suggestions, :third_party_engine], "http://test500?{{host}}&{{user}}") - res = - conn - |> assign(:user, user) - |> get("/api/v1/suggestions") - |> json_response(500) + assert capture_log(fn -> + res = + conn + |> assign(:user, user) + |> get("/api/v1/suggestions") + |> json_response(500) - assert res == "Something went wrong" + assert res == "Something went wrong" + end) =~ "Could not retrieve suggestions" end test "returns suggestions", %{conn: conn, user: user, other_user: other_user} do |