X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Ffallback_test.exs;h=a658658603fcb0efce803a0bf52b92f5a5285d31;hb=dbcc1b105ee1a2552595d189d8ac9d8484ffb601;hp=3b7a51d5e2757a6b0ad8e76f546ceaf08dbbc8a8;hpb=29ae5bb77166d9d7f8108a965b0c3d147b747e80;p=akkoma diff --git a/test/web/fallback_test.exs b/test/web/fallback_test.exs index 3b7a51d5e..a65865860 100644 --- a/test/web/fallback_test.exs +++ b/test/web/fallback_test.exs @@ -11,7 +11,12 @@ defmodule Pleroma.Web.FallbackTest do response = get(conn, "/registration/foo") assert html_response(response, 200) =~ "" - assert html_response(response, 200) =~ "" + end + + test "GET /*path", %{conn: conn} do + assert conn + |> get("/foo") + |> html_response(200) =~ "" end end @@ -21,20 +26,35 @@ defmodule Pleroma.Web.FallbackTest do user_missing = get(conn, "/foo") user_present = get(conn, "/#{user.nickname}") - assert html_response(user_missing, 200) =~ "" + assert(html_response(user_missing, 200) =~ "") refute html_response(user_present, 200) =~ "" + assert html_response(user_present, 200) =~ "initial-results" + end - assert html_response(user_missing, 200) =~ "" - refute html_response(user_present, 200) =~ "" + test "GET /*path", %{conn: conn} do + assert conn + |> get("/foo") + |> html_response(200) =~ "" + + refute conn + |> get("/foo/bar") + |> html_response(200) =~ "" end end - describe "preloaded data only attached to" do - test "GET /*path", %{conn: conn} do + describe "preloaded data is attached to" do + test "GET /main/public", %{conn: conn} do public_page = get(conn, "/main/public") - assert html_response(public_page, 200) =~ "" - refute html_response(public_page, 200) =~ "" + refute html_response(public_page, 200) =~ "" + assert html_response(public_page, 200) =~ "initial-results" + end + + test "GET /main/all", %{conn: conn} do + public_page = get(conn, "/main/all") + + refute html_response(public_page, 200) =~ "" + assert html_response(public_page, 200) =~ "initial-results" end end @@ -48,16 +68,6 @@ defmodule Pleroma.Web.FallbackTest do assert redirected_to(get(conn, "/pleroma/admin")) =~ "/pleroma/admin/" end - test "GET /*path", %{conn: conn} do - assert conn - |> get("/foo") - |> html_response(200) =~ "" - - assert conn - |> get("/foo/bar") - |> html_response(200) =~ "" - end - test "OPTIONS /*path", %{conn: conn} do assert conn |> options("/foo")