Update this test

This commit is contained in:
Michael Klishin 2014-03-02 21:02:59 +04:00
parent 4b417ec15a
commit 413d4484b8

View file

@ -12,20 +12,18 @@
(defn enable-search
[f]
(is (ok? (cmd/admin-command {:setParameter "*" :textSearchEnabled true})))
(is (ok? (cmd/admin-command (array-map :textSearchEnabled true :setParameter "*"))))
(f))
(use-fixtures :each purge-docs)
(use-fixtures :once enable-search)
(deftest ^{:edge-features true :search true} test-basic-full-text-search-query
(deftest ^{:search true} test-basic-full-text-search-query
(let [coll "docs"]
(mc/ensure-index coll (array-map :subject "text" :content "text"))
(mc/insert coll {:subject "hello there" :content "this should be searchable"})
(mc/insert coll {:subject "untitled" :content "this is just noize"})
(let [res (ms/search coll "hello")
xs (ms/results-from res)]
(is (ok? res))
(println res)
(is (= "hello there" (-> xs first :obj :subject)))
(is (= 1.0 (-> xs first :score))))))