playframework/playframework — pull request #1646 by jroper (2013-09-12 02:56:40+00:00)
Title: [2.1.3-scala], Problem with fillAndValidate on Form

When I do a fold on my form after I have done a fillAndValidate the error function isn't called.

```scala
"The form mapping" should {

import play.api.data._
import play.api.data.Forms._

"fold on error after fillAndValidate" in {
case class Item(text: String)
val itemForm = Form(mapping("text" -> nonEmptyText)(Item)(Item.unapply))
val filled = itemForm.fillAndValidate(Item(""))

val result = filled.fold(
errors => false,
success => true
)
result should beFalse
}

"find nested error on unbind" in {
case class Item(text: String)
case class Items(seq: Seq[Item])
val itemForm = Form[Items](
mapping(
"seq" -> seq(
mapping("text" -> nonEmptyText)(Item)(Item.unapply)
)
)(Items)(Items.unapply)
)

val result = itemForm.mapping.unbind(Items(Seq(Item(""))))
result._2 must haveSize(1)
}
}
```