Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move evolution scripts to the conf/ directory.
- Loading branch information
1 parent
3a0382e
commit 021b6f2
Showing
16 changed files
with
170 additions
and
2,118 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package test | ||
|
||
import org.specs2.mutable._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
|
||
import play.api.data._ | ||
import play.api.data.Forms._ | ||
|
||
class FormSpec extends Specification { | ||
|
||
val userForm = Form( | ||
tuple( | ||
"email" -> text, | ||
"address" -> optional( | ||
single("city" -> nonEmptyText) | ||
) | ||
) | ||
) | ||
|
||
"the userForm" should { | ||
|
||
"don't bind the address if missing" in { | ||
|
||
val (email, address) = userForm.bind( | ||
Map("email" -> "coco") | ||
).get | ||
|
||
email must equalTo("coco") | ||
address must beNone | ||
|
||
} | ||
|
||
"don't bind the address if blank" in { | ||
|
||
val (email, address) = userForm.bind( | ||
Map("email" -> "coco", "address.city" -> "") | ||
).get | ||
|
||
email must equalTo("coco") | ||
address must beNone | ||
|
||
} | ||
|
||
"bind the address" in { | ||
|
||
val (email, address) = userForm.bind( | ||
Map("email" -> "coco", "address.city" -> "Paris") | ||
).get | ||
|
||
email must equalTo("coco") | ||
address must beSome.which(_ == "Paris") | ||
|
||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.