defmodule TarakanWeb.InfestationRedirectControllerTest do
  use TarakanWeb.ConnCase, async: true

  test "GET /patterns permanently redirects to /infestations", %{conn: conn} do
    conn = get(conn, ~p"/patterns")
    assert redirected_to(conn, 301) == ~p"/infestations"
  end

  test "GET /patterns/:pattern_key permanently redirects to /infestations/:pattern_key", %{
    conn: conn
  } do
    conn = get(conn, ~p"/patterns/some-pattern-key")
    assert redirected_to(conn, 301) == ~p"/infestations/some-pattern-key"
  end
end
