   (testing "Creating matches"
     (let [db            (memory-db)
           create-player (fn [seed]
-                          (let [id (make-uuid)]
-                            (d/create-player! db id (str "name" seed) (str "openid" seed))
-                            id))
+                          (let [id (make-uuid)
+                                name (str "name-" seed)
+                                openid (str "openid-" seed)]
+                            (d/create-player! db id name openid )
+                            (util/symbols-as-map id name openid)))
           [p1 p2 p3 p4] (map create-player ["p1" "p2" "p3" "p3"])
-          match-date (java.util.Date.)]
-      (testing "We can create a match with our four players"
+          match-date (java.util.Date.)
+          team1score 10
+          team2score 5
+          reporter (create-player "reporter")]
+      (testing "We can create a match with our four players,"
         (is (not= nil (d/create-match! db {:matchdate match-date
-                                           :team1 {:player1 p1 :player2 p2 :score 10}
-                                           :team2 {:player1 p3 :player2 p4 :score 5}
-                                           :reported-by p1})))))))
+                                           :team1 {:player1 (:id p1) :player2 (:id p2) :score team1score}
+                                           :team2 {:player1 (:id p3) :player2 (:id p4) :score team2score}
+                                           :reported-by (:id reporter)})))
+        (testing "then we can get it out again"
+          (let [result (d/get-matches db)]
+            (is (diff-with-first-nil? {:matchdate match-date
+                                       :team1 {:player1 (:name p1) :player2 (:name p2) :score team1score}
+                                       :team2 {:player1 (:name p3) :player2 (:name p4) :score team2score}
+                                       :reported-by (:name reporter)}
+                                      (first result)))
+            (is (= 1 (count result)))))))))

  (:require [foosball.models.db :refer :all]
            [com.stuartsierra.component :as c]
            [foosball.models.domains :as d]
            [clojure.test :refer :all]
            [taoensso.timbre :as t]))

(defn memory-db []
  (c/start


(use-fixtures :each log-fixture)

(defn diff-with-first-nil? [expected actual]
  (let [diff (first (data/diff expected actual))]
    (when diff (pprint {:diff diff}))
    (= nil (first (data/diff expected actual)))))

(defn make-uuid []
  (java.util.UUID/randomUUID))
