KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to test an action on a controller. It's a rather simple action, it takes JSON and returns JSON: def createGroup = Action(parse.json) { request => val name = (request.body \ "name").as[String] val collabs = (request.body \ "collabs").as[List[String]] Ok(Json.toJson( Map("status" -> "OK", "message" -> "%s created".format(name)) )) } I want to verify that the JSON returned is indeed correct. How would I use FakeRequest to do this?
Tags (comma-separated)
Save Edits
Cancel