Enable the config file in test suite
This commit is contained in:
parent
2b7ce1d186
commit
7258af44c3
1 changed files with 30 additions and 7 deletions
37
test/Spec.hs
37
test/Spec.hs
|
@ -1211,17 +1211,40 @@ unwrapDoc _ = []
|
||||||
startAPI :: Config -> IO ()
|
startAPI :: Config -> IO ()
|
||||||
startAPI config = do
|
startAPI config = do
|
||||||
putStrLn "Starting test server ..."
|
putStrLn "Starting test server ..."
|
||||||
pipe <- connect $ host "127.0.0.1"
|
pipe <- connect $ host $ c_dbHost config
|
||||||
c <- access pipe master "zgo" (auth "zgo" "zcashrules")
|
c <- access pipe master "zgo" (auth (c_dbUser config) (c_dbPassword config))
|
||||||
let appRoutes = routes pipe config
|
let appRoutes = routes pipe config
|
||||||
_ <- forkIO (scotty 3000 appRoutes)
|
_ <- forkIO (scotty 3000 appRoutes)
|
||||||
_ <-
|
_ <-
|
||||||
access pipe master "test" (Database.MongoDB.delete (select [] "wootokens"))
|
access
|
||||||
_ <- access pipe master "test" (Database.MongoDB.delete (select [] "users"))
|
pipe
|
||||||
_ <- access pipe master "test" (Database.MongoDB.delete (select [] "items"))
|
master
|
||||||
_ <- access pipe master "test" (Database.MongoDB.delete (select [] "orders"))
|
(c_dbName config)
|
||||||
|
(Database.MongoDB.delete (select [] "wootokens"))
|
||||||
_ <-
|
_ <-
|
||||||
access pipe master "test" (Database.MongoDB.delete (select [] "xerotokens"))
|
access
|
||||||
|
pipe
|
||||||
|
master
|
||||||
|
(c_dbName config)
|
||||||
|
(Database.MongoDB.delete (select [] "users"))
|
||||||
|
_ <-
|
||||||
|
access
|
||||||
|
pipe
|
||||||
|
master
|
||||||
|
(c_dbName config)
|
||||||
|
(Database.MongoDB.delete (select [] "items"))
|
||||||
|
_ <-
|
||||||
|
access
|
||||||
|
pipe
|
||||||
|
master
|
||||||
|
(c_dbName config)
|
||||||
|
(Database.MongoDB.delete (select [] "orders"))
|
||||||
|
_ <-
|
||||||
|
access
|
||||||
|
pipe
|
||||||
|
master
|
||||||
|
(c_dbName config)
|
||||||
|
(Database.MongoDB.delete (select [] "xerotokens"))
|
||||||
let myUser =
|
let myUser =
|
||||||
User
|
User
|
||||||
(Just (read "6272a90f2b05a74cf1000001" :: ObjectId))
|
(Just (read "6272a90f2b05a74cf1000001" :: ObjectId))
|
||||||
|
|
Loading…
Reference in a new issue