Created
March 23, 2012 11:28
-
-
Save minglis/2169779 to your computer and use it in GitHub Desktop.
routeAndCallPlay2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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