                        :family-as-child "@FAM1@"
                        :family-as-spouse "@FAM2@"
                        })]
-        (let [page (apply str (record {:get-data (fn [] 'fake-data)} "@I23@"))]
+        (let [page (get-page record "@I23@")]
           (is (= @trapped-query {:xref "@I23@"}))
-          (is (.contains page "INDIVIDUAL"))
-          (is (.contains page "Bob Smith (a.k.a. Robert Smith, The Guy from The Cure)"))
-          (is (.contains page "Sex: M"))
-          (is (.contains page "Born: 1 JAN 1970 00:00:00 near his mother"))
-          (is (.contains page "Died: 1 JAN 2000 00:00:00 graveside"))
-          (is (.contains page "Buried: 2 JAN 2000 00:00:00 6 feet under"))
-          (is (.contains page "<a href=\"/records/@FAM1@\">Go To Family (where this person was a child)</a>"))
-          (is (.contains page "<a href=\"/records/@FAM2@\">Go To Family (where this person was a spouse)</a>") page)))))
+          (are-on-page
+           "INDIVIDUAL"
+           "Bob Smith (a.k.a. Robert Smith, The Guy from The Cure)"
+           "Sex: M"
+           "Born: 1 JAN 1970 00:00:00 near his mother"
+           "Died: 1 JAN 2000 00:00:00 graveside"
+           "Buried: 2 JAN 2000 00:00:00 6 feet under"
+           "<a href=\"/records/@FAM1@\">Go To Family (where this person was a child)</a>"
+           "<a href=\"/records/@FAM2@\">Go To Family (where this person was a spouse)</a>")))))
 
   (testing "individual record - with parts missing"
     (with-redefs [data/find-record
                   (constantly {:type :individual})]
-      (let [page (apply str (record {:xref "@I23@" :get-data (constantly 'fake-data)}))]
-        (doseq [x '("Name" "Sex" "Born" "Died" "Buried" "Go To Family")]
-          (is (not (.contains page x))
-              (str "Should not find '" x "' on page.")))))))
+      (let [page (get-page record "@I23@")]
+        (are [text] (page-not-contains? text)
+             "Name" "Sex" "Born" "Died" "Buried" "Go To Family")))))

  (:require [ahnentafel.server.pages :refer :all])
  (:require [ahnentafel.gedcom.data :as data])
  (:require [clojure.test :refer :all]))

(deftest home-page-test
  (with-redefs [data/header (constantly {:number-of-records 23

                                         :encoding "ANSEL"
                                         :submitter {:xref "@I31@"
                                                     :name "Fred Smith"}})]
    (let [page (get-page home)]
      (are-on-page
       "<title>Ahnentafel</title>"
       "23 records in test.ged."
       "id=\"home-contents\""
       "created by Author"
       "for Recipient"
       "on 13 SEP 2000"
       "GEDCOM version 5.5.1 (LINEAGE-LINKED ANSEL)"
       "Submitted by <a href=\"/records/@I31@\">Fred Smith</a>"
       "<span id=\"version\">x.x.x</span>"))))

(deftest page-not-found-test
  (let [page (get-page not-found {:uri "/unknown"})]
    (are-on-page
     "<title>Ahnentafel</title>"
     "/unknown not found."
     "<span id=\"version\">x.x.x</span>")))

(deftest record-page-test
  (testing "individual record - maximum data"
