From 8bb94b824af7f7986e85a5840e50c45a43554bbd Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Tue, 17 May 2022 16:30:46 -0500 Subject: [PATCH] Implement test for expirations --- test/Spec.hs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/Spec.hs b/test/Spec.hs index 62bbfb9..b586d96 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -105,8 +105,6 @@ main = res <- httpJSON req height (getResponseBody (res :: Response Block)) `shouldSatisfy` \x -> x > 1600000 - describe "unconfirmed Zcash txs" $ do - it "returns txs with less than 2 confirmations" $ do pending describe "User endpoint" $ do it "returns a user for a session" $ do req <- @@ -308,6 +306,20 @@ main = let ownerPaid = maybe False opaid s ownerPaid `shouldBe` True _ -> True `shouldBe` False `debug` "Failed parsing payment" + it "owners are expired" $ \p -> do + _ <- expireOwners p "test" + now <- getCurrentTime + res <- + access + p + master + "test" + (rest =<< + find + (select + ["expiration" =: ["$lt" =: now], "paid" =: True] + "owners")) + res `shouldBe` [] it "login txs are converted to users" $ \p -> do let myTx = ZGoTx