I built a simple Scala Lift application with REST endpoint.
I want to write some tests. But Lift's testing documentation is horrible :/
Everyone points to this 2012 gist https://gist.github.com/heralight/2235088
Can anyone teach me how to write a simple test? I need something like the gist example:
"process a JSON RestHelper Request" withReqFor("http://foo.com/api/info.json") in { req =>
(WebSpecSpecRest(req)() match {
case Full(JsonResponse(_, _, _, 200)) => true
case other => failure("Invalid response : " + other); false
}) must_== true
}
I found that Lift has its WebSpec, can I use that? (WebSpec's doc is not therehttps://www.assembla.com/wiki/show/liftweb/WebSpec)
Or can anybody point me to a tutorial? I'm reaaally lost.