Skip to content

Instantly share code, notes, and snippets.

@minglis
Created March 23, 2012 11:28
Show Gist options
  • Save minglis/2169779 to your computer and use it in GitHub Desktop.
Save minglis/2169779 to your computer and use it in GitHub Desktop.
routeAndCallPlay2.0
"submitting a valid date of birth should put it into the session" in {
val Some(result) = routeAndCall(FakeRequest(POST, "/test").withFormUrlEncodedBody("test" -> "value")
status(result) must equalTo(SEE_OTHER)
}
def submit = Action {
implicit request => {
testForm.bindFromRequest.fold(
errors => BadRequest(html.test(errors)).withSession("test" -> "TEST"),
form => Redirect(routes.NextTest.index()).withSession("test" -> "SOME MORE TEST VALUES")
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment