   end
 
   test "lists all entries on index", %{conn: conn} do
-    conn = get_authenticated(conn, "/badges")
+    conn = get(conn, "/badges", token: valid_read_token)
 
     assert json_response(conn, 200)["data"] == []
   end

    Repo.insert! valid_badge

    assert_error_sent 404, fn ->
      get_authenticated(conn, "/badges/coverage.svg")
    end
  end

  test "renders page not found when id is nonexistent", %{conn: conn} do
    assert_error_sent 404, fn ->
      get_authenticated(conn, "/badges/dont_exist.svg")
    end
  end


  test "renders SVG when it's available", %{conn: conn} do
    Repo.insert! valid_badge_with_svg

    conn = get(conn, "/badges/coverage.svg", token: valid_read_token)

    assert conn.resp_body == "<svg />"
    assert get_header(conn, "content-type") == "image/svg+xml"
