git.iko.soy/typeable/bloodhound
on master help sign in
cleanup
5d5b954Chris Allen
tests/tests.hs+7−4
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveGeneric, OverloadedStrings, TemplateHaskell #-}
1+{-# LANGUAGE DeriveGeneric, OverloadedStrings #-}
2
2
3module Main where
3module Main where
4
4
@@ -51,8 +51,11 @@ main = hspec $ do
51 let encoded = encode tweet
51 let encoded = encode tweet
52 _ <- deleteExampleIndex
52 _ <- deleteExampleIndex
53 created <- createExampleIndex
53 created <- createExampleIndex
54− docCreated <- indexDocument (Server "http://localhost:9200") "twitter" "tweet" tweet "1"
54+ docCreated <- indexDocument (Server "http://localhost:9200")
55+ "twitter" "tweet" tweet "1"
55− docInserted <- getDocument (Server "http://localhost:9200") "twitter" "tweet" "1"
56+ docInserted <- getDocument (Server "http://localhost:9200")
57+ "twitter" "tweet" "1"
58+ let newTweet = decode
56− let newTweet = decode (responseBody docInserted) :: Maybe (EsResult Tweet)
59+ (responseBody docInserted) :: Maybe (EsResult Tweet)
57 deleted <- deleteExampleIndex
60 deleted <- deleteExampleIndex
58 Just tweet `shouldBe` fmap _source newTweet
61 Just tweet `shouldBe` fmap _source newTweet