0
我試圖在將它放到生產服務器上後測試我的play 2.5應用程序。基本上我只想運行與生產服務器設置一起在我的ApplicationSpec.scala中編寫的相同測試。我跟着文檔,但無法創建應用程序實例:如何編寫生產服務器測試與OneServerPerSuite一起玩
import play.api.test.Helpers.{GET => GET_REQUEST, _}
import play.api.test._
class ProductionSpec extends PlaySpec with OneServerPerSuite {
implicit override lazy val app =
new GuiceApplicationBuilder().disable[EhCacheModule].router(Router.from {
case GET(p"/") => Action { play.api.mvc.Results.Ok("ok") }
}).build()
"AuthController" should {
"initialize tables" in {
val init = route(app, FakeRequest(GET, "/init")).get
status(init) mustBe OK
}
}
}
誤差
ProductionSpec.scala:25: not found: value GET
...
ProductionSpec.scala:25: value p is not a member of StringContext
如何測試應用程序的生產環境中運行?