 (defn- prepare-citelinks [cites]
   (map (fn [doc]
          (assoc (escape-fields doc)
-           :url (url-path-for-docid :text (:docid doc))
+           :url (absolute-url-path-for-docid :text (:docid doc))
            :name (str/truncate (:name doc) 30)))
        (reverse (sort-by :date cites))))
   


(defn- url-path-for-docid [type docid]
  (if (= type :text)
    (str "/v1/cases/" docid)
    (str "/v1/cases/" docid "/" (name type))))

(defn- doclinks [doc]
  (let [docid (:docid doc)]
    [{:name "Full Text"
      :url (url-path-for-docid :text docid)}
     {:name "Citations to/from this"
      :url (url-path-for-docid :citations docid)}]))

(defn- file-path-for-docid [type docid]
  (str "docs/" (files/docid-path docid) "-" (name type) ".html"))

(defmulti #^{:private true} gen-case-layout (fn [type doc] type))


    (is (re-find #"<.*class=\"name\".*>John &amp; Sons v\. Thurber</" page))
    (is (re-find #"<.*class=\"date\".*>January 4, 2009</" page))
    (is (re-find #"<.*class=\"citations\".*>1 F.2d 101; 5 L.Ed. 102</" page))
    (is (re-find #"<.*class=\"court\".*>United States Court of Appeals for the Third Circuit</" page))
    (is (not (re-find #"robots.*noindex" page)))))


(deftest- can-generate-cites-page
