Fix map comparisons and rename test case

Two tests had the same name so only the latter was ran
This commit is contained in:
Juho Teperi 2015-10-08 22:42:06 +03:00
parent 2dc5e92b0c
commit fe73144075

View file

@ -112,20 +112,20 @@
(.put "name" name) (.put "name" name)
(.put "age" age)) (.put "age" age))
output (from-db-object input false)] output (from-db-object input false)]
(is (= (output { "name" name, "age" age }))) (is (= output { "name" name, "age" age }))
(is (= (output "name") name)) (is (= (output "name") name))
(is (nil? (output :name))) (is (nil? (output :name)))
(is (= (output "age") age)) (is (= (output "age") age))
(is (nil? (output "points"))))) (is (nil? (output "points")))))
(deftest convert-flat-db-object-to-map-without-keywordizing (deftest convert-flat-db-object-to-map-with-keywordizing
(let [name "Michael" (let [name "Michael"
age 26 age 26
input (doto (BasicDBObject.) input (doto (BasicDBObject.)
(.put "name" name) (.put "name" name)
(.put "age" age)) (.put "age" age))
output (from-db-object input true)] output (from-db-object input true)]
(is (= (output { :name name, :age age }))) (is (= output { :name name, :age age }))
(is (= (output :name) name)) (is (= (output :name) name))
(is (nil? (output "name"))) (is (nil? (output "name")))
(is (= (output :age) age)) (is (= (output :age) age))