Implement test for expirations
This commit is contained in:
parent
b3482da312
commit
8bb94b824a
1 changed files with 14 additions and 2 deletions
16
test/Spec.hs
16
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
|
||||
|
|
Loading…
Reference in a new issue