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
|
res <- httpJSON req
|
||||||
height (getResponseBody (res :: Response Block)) `shouldSatisfy` \x ->
|
height (getResponseBody (res :: Response Block)) `shouldSatisfy` \x ->
|
||||||
x > 1600000
|
x > 1600000
|
||||||
describe "unconfirmed Zcash txs" $ do
|
|
||||||
it "returns txs with less than 2 confirmations" $ do pending
|
|
||||||
describe "User endpoint" $ do
|
describe "User endpoint" $ do
|
||||||
it "returns a user for a session" $ do
|
it "returns a user for a session" $ do
|
||||||
req <-
|
req <-
|
||||||
|
@ -308,6 +306,20 @@ main =
|
||||||
let ownerPaid = maybe False opaid s
|
let ownerPaid = maybe False opaid s
|
||||||
ownerPaid `shouldBe` True
|
ownerPaid `shouldBe` True
|
||||||
_ -> True `shouldBe` False `debug` "Failed parsing payment"
|
_ -> 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
|
it "login txs are converted to users" $ \p -> do
|
||||||
let myTx =
|
let myTx =
|
||||||
ZGoTx
|
ZGoTx
|
||||||
|
|
Loading…
Reference in a new issue