Permalink
Browse files

Refactor.

  • Loading branch information...
1 parent 288d94c commit 5c62c46775e4bc1f01503bf17116882848dff31d @drewr drewr committed Sep 20, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 test/esperanto/test/search.clj
@@ -56,15 +56,17 @@
coll (doc-seq ct)
ids (into #{} (map :id coll))
bulk (index-bulk client index coll)
- _ (refresh client index)]
+ _ (refresh client index)
+ sresp (search client index)
+ xs (index-seq client index)]
(is (not (.hasFailures bulk)))
;; How many docs does ES think the index has?
(is (= ct (count client index)))
;; How many docs does a search for all docs return?
- (is (= ct (-> (search client index) meta :total)))
+ (is (= ct (-> sresp meta :total)))
;; Are the ids exactly what we indexed?
- (is (= ct (clojure.core/count (index-seq client index))))
- (is (= ids (into #{} (map :id (index-seq client index)))))))
+ (is (= ct (clojure.core/count xs)))
+ (is (= ids (into #{} (map :id xs))))))
(deftest t-count
(index-doc client index doc)

0 comments on commit 5c62c46

Please sign in to comment.