Demo app using the Scala Play framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

30 lines
789 B

11 years ago
  1. import org.specs2.mutable._
  2. import org.specs2.runner._
  3. import org.junit.runner._
  4. import play.api.test._
  5. import play.api.test.Helpers._
  6. /**
  7. * Add your spec here.
  8. * You can mock out a whole application including requests, plugins etc.
  9. * For more information, consult the wiki.
  10. */
  11. @RunWith(classOf[JUnitRunner])
  12. class ApplicationSpec extends Specification {
  13. "Application" should {
  14. "send 404 on a bad request" in new WithApplication{
  15. route(FakeRequest(GET, "/boum")) must beNone
  16. }
  17. "render the index page" in new WithApplication{
  18. val home = route(FakeRequest(GET, "/")).get
  19. status(home) must equalTo(OK)
  20. contentType(home) must beSome.which(_ == "text/html")
  21. contentAsString(home) must contain ("Your new application is ready.")
  22. }
  23. }
  24. }