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.

27 lines
758 B

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