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?

Edit
Report