Skip to content

Instantly share code, notes, and snippets.

@nicmarti
Created March 1, 2013 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicmarti/5064048 to your computer and use it in GitHub Desktop.
Save nicmarti/5064048 to your computer and use it in GitHub Desktop.
Play2 and Spec simple test - Demo for Confoo
package models
import org.specs2.mutable._
import play.api.test._
import play.api.test.Helpers._
class OriginSpecs extends Specification {
"An Origin" should {
"returns the slug for a valid origin" in {
running(FakeApplication()) {
Origin.getSlug(380) mustEqual Some("from-london")
Origin.getSlug(1) mustEqual Some("from-paris")
Origin.getSlug(-9999) mustEqual None
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment