From fbd631b22efa4bbdf00770a99fe933b7d059c506 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Tue, 10 Apr 2012 16:12:59 +0400 Subject: [PATCH] Add a test that inserts documents with fields that are Clojure records --- test/monger/test/inserting.clj | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/monger/test/inserting.clj b/test/monger/test/inserting.clj index 7924451..6538096 100644 --- a/test/monger/test/inserting.clj +++ b/test/monger/test/inserting.clj @@ -63,6 +63,17 @@ (is (= 5.5 (:ratio (mgcol/find-map-by-id collection id)))))) +(defrecord Metrics + [rps eps]) + +(deftest ^:focus insert-a-document-with-clojure-record-in-it + (let [collection "widgets" + id (ObjectId.) + doc { :record (Metrics. 10 20) "_id" id } + result (mgcol/insert "widgets" doc)] + (is (= {:rps 10 :eps 20} (:record (mgcol/find-map-by-id collection id)))))) + + ;; ;; insert-batch