Test for case-insensitive mastodon hashtag timelines.
authorlain <lain@soykaf.club>
Sat, 3 Nov 2018 10:41:40 +0000 (11:41 +0100)
committerlain <lain@soykaf.club>
Sat, 3 Nov 2018 10:41:40 +0000 (11:41 +0100)
test/web/mastodon_api/mastodon_api_controller_test.exs

index 938d556c762d4e9f2bc98026fc3f91ee820eb38f..3f9324fccc76f4fad1bf74d257b974feca714c29 100644 (file)
@@ -944,11 +944,20 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
       {:ok, [_activity]} =
         OStatus.fetch_activity_from_url("https://shitposter.club/notice/2827873")
 
-      conn =
+      nconn =
         conn
         |> get("/api/v1/timelines/tag/2hu")
 
-      assert [%{"id" => id}] = json_response(conn, 200)
+      assert [%{"id" => id}] = json_response(nconn, 200)
+
+      assert id == to_string(activity.id)
+
+      # works for different capitalization too
+      nconn =
+        conn
+        |> get("/api/v1/timelines/tag/2HU")
+
+      assert [%{"id" => id}] = json_response(nconn, 200)
 
       assert id == to_string(activity.id)
     end)