     assert page_path(%Plug.Conn{}, :stats) == "/stats"
 
     conn = call(Router, :get, "stats")
-    fwd_conn = conn.assigns[:fwd_conn]
-    assert page_path(fwd_conn, :stats) == "/admin/stats"
     assert page_path(conn, :stats) == "/admin/stats"
 
     conn = call(Router, :get, "stats", _params = nil, _headers = [], ["phx"])
-    fwd_conn = conn.assigns[:fwd_conn]
-    assert page_path(fwd_conn, :stats) == "/phx/admin/stats"
     assert page_path(conn, :stats) == "/phx/admin/stats"
 
     conn = call(Router, :get, "admin/stats")
-    fwd_conn = conn.assigns[:fwd_conn]
-    assert page_path(fwd_conn, :stats) == "/admin/stats"
     assert page_path(conn, :stats) == "/admin/stats"
 
     conn = call(Router, :get, "admin/stats", _params = nil, _headers = [], ["phx"])
-    fwd_conn = conn.assigns[:fwd_conn]
-    assert page_path(fwd_conn, :stats) == "/phx/admin/stats"
     assert page_path(conn, :stats) == "/phx/admin/stats"
   end
 end

  defmodule Controller do
    use Phoenix.Controller

    plug :assign_fwd_conn

    def index(conn, _params), do: text(conn, "admin index")
    def stats(conn, _params), do: text(conn, "stats")
    def api_users(conn, _params), do: text(conn, "api users")
    def api_root(conn, _params), do: text(conn, "api root")
    defp assign_fwd_conn(conn, _), do: assign(conn, :fwd_conn, conn)
  end

  defmodule ApiRouter do


  test "forwards path to plug" do
    conn = call(Router, :get, "admin")
    assert conn.script_name == []
    assert conn.assigns[:fwd_script] == ["admin"]
    assert conn.status == 200
    assert conn.resp_body == "admin index"
  end

  test "forwards any request starting with forward path" do
    conn = call(Router, :get, "admin/stats")
    assert conn.script_name == []
    assert conn.assigns[:fwd_script] == ["admin"]
    assert conn.status == 200
    assert conn.resp_body == "stats"
  end
