HomeControllerSpec.scala 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //package controllers
  2. //
  3. //import org.scalatestplus.play._
  4. //import org.scalatestplus.play.guice._
  5. //import play.api.test._
  6. //import play.api.test.Helpers._
  7. //
  8. ///**
  9. // * Add your spec here.
  10. // * You can mock out a whole application including requests, plugins etc.
  11. // *
  12. // * For more information, see https://www.playframework.com/documentation/latest/ScalaTestingWithScalaTest
  13. // */
  14. //class HomeControllerSpec extends PlaySpec with GuiceOneAppPerTest with Injecting {
  15. //
  16. // "HomeController GET" should {
  17. //
  18. // "render the index page from a new instance of controller" in {
  19. // val controller = new HomeController(
  20. // stubMessagesControllerComponents().messagesActionBuilder,
  21. // stubControllerComponents())
  22. // val home = controller.index().apply(FakeRequest(GET, "/"))
  23. //
  24. // status(home) mustBe OK
  25. // contentType(home) mustBe Some("text/html")
  26. // contentAsString(home) must include ("Welcome to Play")
  27. // }
  28. //
  29. // "render the index page from the application" in {
  30. // val controller = inject[HomeController]
  31. // val home = controller.index().apply(FakeRequest(GET, "/"))
  32. //
  33. // status(home) mustBe OK
  34. // contentType(home) mustBe Some("text/html")
  35. // contentAsString(home) must include ("Welcome to Play")
  36. // }
  37. //
  38. // "render the index page from the router" in {
  39. // val request = FakeRequest(GET, "/")
  40. // val home = route(app, request).get
  41. //
  42. // status(home) mustBe OK
  43. // contentType(home) mustBe Some("text/html")
  44. // contentAsString(home) must include ("Welcome to Play")
  45. // }
  46. // }
  47. //}