February 2018
Intermediate to advanced
552 pages
13h 46m
English
In this section, we will refer to the play-scala-helloworld-di-app Play Scala-based HelloWorld application available in Chapter 6, Extending Application with Play, GitHub folder and write unit tests for our controller.
Perform the same steps that we discussed earlier to update the build.sbt file.
Complete the unit tests spec, as shown here:
package controllersimport org.scalatestplus.play._import play.api.test.Helpers._import play.api.test._class HelloWorldDIControllerSpec extends PlaySpec with OneAppPerTest { "HelloWorldeDIController" should { "render the helloWorld page from Play Routings" in { val helloWorld = route(app, FakeRequest(GET, "/helloWorld")).get status(helloWorld) mustBe OK contentType(helloWorld) ...Read now
Unlock full access